@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/service-wrapper",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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(/^\^\\\/([a-zA-Z0-9_/-]+)/);
1677
- if (match) mountPath = `/${match[1]}`;
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