This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CO-370] Make Content-Type parsing more lenient
We have had a lot of trouble where people will send no content-type or simply 'application/json' and request would fail with 415 Unsupported Media Type. Without knowing where to look, the error looks quite unexpected and could give a lot of headache. This commit does two changes: - It slightly modifies the 'Accept' instance to use 'contentTypes' instead of 'contentType'. The latter is defined from the former by simply taking the head of the list returned by 'contentTypes', which in our case is 'application/json;charset=utf-8' - It provides a default content-type 'application/json' when no content-type is provided
- Loading branch information
Showing
3 changed files
with
34 additions
and
3 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
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