Don't parse the body if it's empty

Refs #290
This commit is contained in:
Andrew Godwin 2022-12-27 16:18:00 -07:00
parent 029e51c8fe
commit b523d34c53
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class FormOrJsonParser(Parser):
def parse_body(self, request):
# Did they submit JSON?
if request.content_type == "application/json":
if request.content_type == "application/json" and request.body.strip():
return json.loads(request.body)
# Fall back to form data
value = {}