Commit 810ce4a9 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

snf-django: BadRequest if no content-type

Raise a BadRequest if request is missing Content-Type header field.
parent 692a6c48
......@@ -96,6 +96,8 @@ def get_request_dict(request):
"""
data = request.raw_post_data
content_type = request.META.get("CONTENT_TYPE")
if content_type is None:
faults.BadRequest("Missing Content-Type header field")
if content_type.startswith("application/json"):
try:
return json.loads(data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment