Skip to content

Commit d43a268

Browse files
committed
fix(deco): get content type header from request attr
1 parent 40e0205 commit d43a268

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

data_spec_validator/decorator/decorators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def _collect_data(method, req_qp, req_data) -> Dict:
104104
return req_data
105105

106106
def _get_dj_payload(request):
107-
content_type = request.headers.get('Content-Type')
108-
if 'application/json' in content_type:
107+
if 'application/json' in request.content_type:
109108
try:
110109
return request.body and json.loads(request.body) or {}
111110
except Exception:

0 commit comments

Comments
 (0)