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

Improper use of req.accepts() -- Accept header ignored as a result #563

Closed
acorretti opened this issue Mar 21, 2014 · 0 comments
Closed

Comments

@acorretti
Copy link

The way Response.format uses the req.accepts() function does not seem right according to its implementation. As a result, browser's "Accept:" header may get ignored and the first formatter defined always used.

As of 2.6.3 Restify is looping over a server's acceptable types, checking each with req.accepts( type ) until one gets returned, to select it.

Instead, Request.accepts should be fed the whole array of acceptable types, to then return the most appropriate one.

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

No branches or pull requests

1 participant