@contrast/route-coverage 1.46.0 → 1.47.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.
@@ -62,11 +62,18 @@ module.exports = function init(core) {
62
62
  patcher.patch(data.result.route.settings, 'handler', {
63
63
  name: 'route.settings.handler',
64
64
  patchType,
65
- post({ args }) {
65
+ // this needs to be in a pre-hook so that the route
66
+ // data is in the store before our dataflow hooks run
67
+ pre({ args }) {
66
68
  const [{ method, path: url, route }] = args;
67
69
  //TODO: Will this signature always be associated with an existing route?
68
70
  const signature = createSignature(method, path);
69
- routeCoverage.observe({ signature, url, method: StringPrototypeToLowerCase.call(method), normalizedUrl: route.path });
71
+ routeCoverage.observe({
72
+ signature,
73
+ url,
74
+ method: StringPrototypeToLowerCase.call(method),
75
+ normalizedUrl: route.path,
76
+ });
70
77
  }
71
78
  });
72
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/route-coverage",
3
- "version": "1.46.0",
3
+ "version": "1.47.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)",