Fix: Correctly handle unset Content-Type header for command requests
This commit is contained in:
parent
fd4271a962
commit
b4b5689bc4
1 changed files with 2 additions and 1 deletions
|
|
@ -530,7 +530,8 @@ def get_remote_address(request):
|
|||
|
||||
|
||||
def get_json_command_from_request(request, valid_commands):
|
||||
if not "application/json" in request.headers["Content-Type"]:
|
||||
content_type = request.headers.get("Content-Type", None)
|
||||
if content_type is None or not "application/json" in content_type:
|
||||
return None, None, make_response("Expected content-type JSON", 400)
|
||||
|
||||
data = request.json
|
||||
|
|
|
|||
Loading…
Reference in a new issue