-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't reject on media type parameters
Restify uses the negotiator module, which will fail to match media types in the client's `accepts` header if there are parameters other than q attached to them. This results in 406 errors when something like "Accepts: text/plain; charset=utf8" is sent. Restify doesn't let you specify the charset as an acceptable parameter; it strips that out of the server's list before checking. This hack removes any charset specifiers from the accepts header. It should probably be removed at a later time, after the negotiator module is fixed (see jshttp/negotiator#35) I found this as swagger-ui's requests have charsets appended to the accepts header, so it was failing with 406 errors.
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters