We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d10a65f commit 9d8d1e4Copy full SHA for 9d8d1e4
flask_rest_jsonapi/decorators.py
@@ -21,8 +21,8 @@ def check_headers(func):
21
@wraps(func)
22
def wrapper(*args, **kwargs):
23
if request.method in ('POST', 'PATCH'):
24
- if 'Content-Type' in request.headers and\
25
- 'application/vnd.api+json' in request.headers['Content-Type'] and\
+ if 'Content-Type' not in request.headers or\
+ 'application/vnd.api+json' not in request.headers['Content-Type'] or\
26
request.headers['Content-Type'] != 'application/vnd.api+json':
27
error = json.dumps(jsonapi_errors([{'source': '',
28
'detail': "Content-Type header must be application/vnd.api+json",
0 commit comments