@contrast/route-coverage 1.56.2 → 1.57.1
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/lib/install/express.js +11 -4
- package/package.json +2 -2
package/lib/install/express.js
CHANGED
|
@@ -325,10 +325,16 @@ class ExpressInstrumentation {
|
|
|
325
325
|
patchType: `${patchType}-observation`,
|
|
326
326
|
pre(data) {
|
|
327
327
|
if (instance[kMetaKey]?.observables) {
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
const handleStore = handleScope.getStore();
|
|
329
|
+
const reqStore = core.scopes.sources.getStore();
|
|
330
|
+
|
|
331
|
+
if (handleStore && reqStore) {
|
|
332
|
+
const method = StringPrototypeToLowerCase.call(
|
|
333
|
+
data.args[0].method ||
|
|
334
|
+
reqStore.sourceInfo?.method ||
|
|
335
|
+
''
|
|
336
|
+
);
|
|
337
|
+
const template = ArrayPrototypeJoin.call(handleStore.templateSegments, '') || '/';
|
|
332
338
|
|
|
333
339
|
if (instance[kMetaKey]?.observables?.[template]) {
|
|
334
340
|
self.observe({
|
|
@@ -521,6 +527,7 @@ class ExpressInstrumentation {
|
|
|
521
527
|
});
|
|
522
528
|
}
|
|
523
529
|
|
|
530
|
+
if (Object.hasOwn(target, kMetaKey)) return;
|
|
524
531
|
Object.defineProperty(target, kMetaKey, {
|
|
525
532
|
enumerable: false,
|
|
526
533
|
value: meta,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/route-coverage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.57.1",
|
|
4
4
|
"description": "Handles route discovery and observation",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@contrast/fn-inspect": "5.0.2",
|
|
28
28
|
"@contrast/logger": "1.36.2",
|
|
29
29
|
"@contrast/patcher": "1.35.2",
|
|
30
|
-
"@contrast/rewriter": "1.40.
|
|
30
|
+
"@contrast/rewriter": "1.40.3",
|
|
31
31
|
"@contrast/scopes": "1.33.2",
|
|
32
32
|
"semver": "7.6.0"
|
|
33
33
|
}
|