@contrast/route-coverage 1.56.1 → 1.57.0

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.
@@ -325,10 +325,16 @@ class ExpressInstrumentation {
325
325
  patchType: `${patchType}-observation`,
326
326
  pre(data) {
327
327
  if (instance[kMetaKey]?.observables) {
328
- const store = handleScope.getStore();
329
- if (store) {
330
- const method = StringPrototypeToLowerCase.call(data.args[0].method || '');
331
- const template = ArrayPrototypeJoin.call(store.templateSegments, '') || '/';
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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/route-coverage",
3
- "version": "1.56.1",
3
+ "version": "1.57.0",
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)",
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.41.1",
24
- "@contrast/config": "1.58.1",
25
- "@contrast/core": "1.63.1",
26
- "@contrast/dep-hooks": "1.32.1",
24
+ "@contrast/config": "1.58.2",
25
+ "@contrast/core": "1.63.2",
26
+ "@contrast/dep-hooks": "1.32.2",
27
27
  "@contrast/fn-inspect": "5.0.2",
28
- "@contrast/logger": "1.36.1",
29
- "@contrast/patcher": "1.35.1",
30
- "@contrast/rewriter": "1.40.1",
31
- "@contrast/scopes": "1.33.1",
28
+ "@contrast/logger": "1.36.2",
29
+ "@contrast/patcher": "1.35.2",
30
+ "@contrast/rewriter": "1.40.3",
31
+ "@contrast/scopes": "1.33.2",
32
32
  "semver": "7.6.0"
33
33
  }
34
34
  }