-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide access to original unparsed path #85
Comments
Hi! Thanks for the feature request. Can you provide more information around what you expect to use this for? For example, if the route is defined as router.get(["/user/:id", "/person/:id"], (req, res, next) => {
console.log(req.originalUnparsedPath); // => "/user/:id"
next();
}); would the expectation here be (a) you get that original array back (b) you get just the element in the array that matched the request url or (c) something else? The feature request to too vague on what the goal is for the usage of this data is to gauge, if you can expand on what specific you're going to use it for as well. For example, what should it provide when there are routers mounted in routers? |
Thanks for reply. router.get(["/user/:id", "/person/:id"], (req, res, next) => {
console.log({ original: req.originalUrl, unparsed: req.originalUnparsedPath });
next();
});
I need to log it out and then create AWS metrics. |
Does this PR satisfy this? #34 |
I suppose that would work, yes. |
closes pillarjs#34 closes pillarjs#85
closes pillarjs#34 closes pillarjs#85
closes pillarjs#34 closes pillarjs#85
I cannot access originalUnparsedPath. I have express 4.18.2 |
As discussed in expressjs/express#4084 there is a need for original path on req object.
Example:
originalUnparsedPath
is just an example, but the name would be something along the lines.The text was updated successfully, but these errors were encountered: