@onlineapps/service-wrapper 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ServiceWrapper.js +4 -2
package/package.json
CHANGED
package/src/ServiceWrapper.js
CHANGED
|
@@ -1672,9 +1672,11 @@ class ServiceWrapper {
|
|
|
1672
1672
|
let mountPath = '';
|
|
1673
1673
|
|
|
1674
1674
|
// Express 4: extract prefix from regexp
|
|
1675
|
+
// Multi-segment paths like /api/v1 produce regexp source ^\/api\/v1\/?...
|
|
1676
|
+
// Each path segment is escaped as \/segment, so we capture all segments.
|
|
1675
1677
|
if (layer.regexp?.source) {
|
|
1676
|
-
const match = layer.regexp.source.match(
|
|
1677
|
-
if (match) mountPath =
|
|
1678
|
+
const match = layer.regexp.source.match(/^\^((?:\\\/[a-zA-Z0-9_.~-]+)+)/);
|
|
1679
|
+
if (match) mountPath = match[1].replace(/\\\//g, '/');
|
|
1678
1680
|
}
|
|
1679
1681
|
|
|
1680
1682
|
// Express 5: probe the matcher to discover mount prefix
|