}
routePath[kPathMethods] = {};
+
+ Object.defineProperty(routePath, 'path', {
+ enumerable: false,
+ value: rawPath,
+ });
+
Object.freeze(routePath);
return routePath;
}
const { matchedPath, pathParams } = this._pathFind(pathParts);
ctx.params = pathParams;
if (matchedPath) {
- ctx.matchedPath = matchedPath;
+ ctx.matchedPath = matchedPath.path;
if (method in matchedPath[kPathMethods]) {
return matchedPath[kPathMethods][method];
}
const { handler } = router.lookup(method, path, ctx);
assert.strictEqual(handler, stubHandler);
+ assert.strictEqual(ctx.matchedPath, urlPath);
});
it('does not find handler with trailing slash', function () {
router.ignoreTrailingSlash = false;