Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 144d304

Browse files
authored
Merge pull request #47 from Natureshadow/patch-1
Fix parsing of Accept header.
2 parents 426da16 + 503d965 commit 144d304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_rest_jsonapi/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def wrapper(*args, **kwargs):
2323
'title': 'InvalidRequestHeader',
2424
'status': 415}]))
2525
return make_response(error, 415, {'Content-Type': 'application/vnd.api+json'})
26-
if request.headers.get('Accept') and request.headers['Accept'] != 'application/vnd.api+json':
26+
if request.headers.get('Accept') and not 'application/vnd.api+json' in request.accept_mimetypes:
2727
error = json.dumps(jsonapi_errors([{'source': '',
2828
'detail': "Accept header must be application/vnd.api+json",
2929
'title': 'InvalidRequestHeader',

0 commit comments

Comments
 (0)