Can we get req.requested_url added to express? #1377

Closed
chovy opened this Issue Oct 21, 2012 · 2 comments

Comments

Projects
None yet
3 participants

chovy commented Oct 21, 2012

res.locals.requested_url = req.protocol + '://' + req.host + ( port == 80 || po
rt == 443 ? '' : ':'+port ) + req.path;

This is what I'm doing now, but there should be an easier way.

Would be nice to just do req.requested_url

you could easily write a middleware for this.
Am 21.10.2012 10:08 schrieb "Anthony Ettinger" notifications@github.com:

res.locals.current_url = req.protocol + '://' + req.host + ( port == 80 ||
po
rt == 443 ? '' : ':'+port ) + req.path;

This is what I'm doing now, but there should be an easier way.


Reply to this email directly or view it on GitHubhttps://github.com/visionmedia/express/issues/1377.

Member

jonathanong commented Oct 30, 2013

@daemonfire300 you can easily write a middleware for everything :P

merging with visionmedia#997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment