Skip to content

Fix media type matching#804

Merged
lgebhardt merged 3 commits intoJSONAPI-Resources:masterfrom
iosadchiy:fix-media-type-matching
Aug 19, 2016
Merged

Fix media type matching#804
lgebhardt merged 3 commits intoJSONAPI-Resources:masterfrom
iosadchiy:fix-media-type-matching

Conversation

@iosadchiy
Copy link
Copy Markdown
Contributor

Bug: When client sends Accept header with allowed media type not in the first position, the request gets rejected. For example:

GET /posts
Accept: application/json, application/vnd.api+json, */*

Expected: HTTP 200 OK
Got: HTTP 406 Not acceptable

This happens due to incorrect header parsing in JSONAPI::ActsAsResourceController#media_types_for. The PR addresses the issue

@lgebhardt lgebhardt merged commit a0311e6 into JSONAPI-Resources:master Aug 19, 2016
@lgebhardt
Copy link
Copy Markdown
Contributor

@iosadchii Thanks!

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.

2 participants