Skip to content
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

should use req.originalUrl for express requestUrl #472

Closed
hgiasac opened this issue May 8, 2019 · 2 comments
Closed

should use req.originalUrl for express requestUrl #472

hgiasac opened this issue May 8, 2019 · 2 comments
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@hgiasac
Copy link
Contributor

hgiasac commented May 8, 2019

Currently requestUrl request data in middleware is using req.url variable. In express, req.url only returns sub-route.

const router = express.Router();
router.get('/', (req, res) => { ... })

app.use('/users', router);

Console Log

There are many cases that we use nested routes in express for modularization. It is better to use req.originalUrl for getting full path.

https://expressjs.com/en/api.html#req.originalUrl

I am ready to make PR. However, I need to verify that this feature can be doable or not.

Thanks

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label May 8, 2019
@bcoe bcoe added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels May 8, 2019
@bcoe
Copy link
Contributor

bcoe commented May 8, 2019

@ofrobots can speak to this a bit better than me, but sounds like a worthwhile patch.

@ofrobots
Copy link
Contributor

ofrobots commented May 8, 2019

@hgiasac 👍. Looking forward to the PR!

@google-cloud-label-sync google-cloud-label-sync bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants