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

specialcase .:format routing to not include a dot in the capture group #785

Closed
wants to merge 1 commit into from
Closed

Conversation

Swatinem
Copy link
Contributor

Per visionmedia/express-resource#27 (comment) I pushed that special case into express.

app.get('/user/:name.:format?', function(req, res){
res.send(req.params.name + ' - ' + (req.params.format || ''));
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main problem with these .format things really is the ambiguity, for example if you have "/commits/foo.bar" with an optional format ".bar" could be the format, or later ".patch" could be the format which would be expected but ".bar" could be part of the value, and unexpectedly become the format. IMO this is why people should just always use Accept instead

@jonathanong
Copy link
Member

fixed according to the linked comment

@jonathanong jonathanong closed this Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants