Skip to content

Commit da67723

Browse files
committed
add concistency to exception title for headers purpose and add feature to not allow to disable pagination
1 parent ea83fc2 commit da67723

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: flask_rest_jsonapi/decorators.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def wrapper(*args, **kwargs):
2323
request.headers['Content-Type'] != 'application/vnd.api+json':
2424
error = jsonify(jsonapi_errors([{'source': '',
2525
'detail': "Content-Type header must be application/vnd.api+json",
26-
'title': 'InvalidRequestHeader',
26+
'title': 'Invalid request header',
2727
'status': '415'}]))
2828
return make_response(error, 415, {'Content-Type': 'application/vnd.api+json'})
2929
if 'Accept' in request.headers:
@@ -36,8 +36,9 @@ def wrapper(*args, **kwargs):
3636
flag = True
3737
if flag is True:
3838
error = jsonify(jsonapi_errors([{'source': '',
39-
'detail': "Accept header must be application/vnd.api+json",
40-
'title': 'InvalidRequestHeader',
39+
'detail': ('Accept header must be application/vnd.api+json without'
40+
'media type parameters'),
41+
'title': 'Invalid request header',
4142
'status': '406'}]))
4243
return make_response(error, 406, {'Content-Type': 'application/vnd.api+json'})
4344
return func(*args, **kwargs)

0 commit comments

Comments
 (0)