parent
532ac0264d
commit
772ee76e76
1 changed files with 4 additions and 1 deletions
|
|
@ -1116,7 +1116,7 @@ def restricted_access(func):
|
|||
def firstrun_only_access(func):
|
||||
"""
|
||||
If you decorate a view with this, it will ensure that first setup has _not_ been
|
||||
done for OctoPrint's Access Control. Otherwise it
|
||||
done for OctoPrint's Access Control. Otherwise it
|
||||
will cause a HTTP 403 status code to be returned by the decorated resource.
|
||||
"""
|
||||
@functools.wraps(func)
|
||||
|
|
@ -1211,6 +1211,9 @@ def get_json_command_from_request(request, valid_commands):
|
|||
return None, None, make_response("Expected content-type JSON", 400)
|
||||
|
||||
data = request.json
|
||||
if data is None:
|
||||
return None, None, make_response("Expected content-type JSON", 400)
|
||||
|
||||
if not "command" in data.keys() or not data["command"] in valid_commands.keys():
|
||||
return None, None, make_response("Expected valid command", 400)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue