Prevent .:format for e-mail addresses in url? #48

Closed
PatrickHeneise opened this Issue Jan 5, 2012 · 6 comments

Projects

None yet

3 participants

@PatrickHeneise

I'm authenticating with google and using the e-mail address as user name. For user/show the URL is /user/abc@abc.com. This will always download a file abc@abc.com, even though it should res.render 'user/show'. How can I prevent that? I tried setting req.format and req.params.format to undefined, but didn't work.

@tj
expressjs member
tj commented Jan 5, 2012

ideally we'd just use Accept, since that's what it's for

@PatrickHeneise

header.accept = "text/plain", or how do I do that?

@tj
expressjs member
tj commented Jan 6, 2012

alternatively we could white-list formats, but then that gets a bit opinionated and messy, but otherwise it's ambiguous

@tj
expressjs member
tj commented Jan 6, 2012

but yeah we would just parse Accept's values/qualities and see if any of those formats are available

@PatrickHeneise

res.contentType('text/html');

Thanks!

@kb19

I just ran into this issue, passing an email in the url. Where did you put that res.contentType('text/html') code?

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