Pass allowed arguments into missing args error
This commit is contained in:
parent
4710e6ba7b
commit
807c06504f
|
@ -4,7 +4,10 @@ allowed_args = ["file_hash", "file_version", "timestamp"]
|
|||
|
||||
def handle(request):
|
||||
if len([x for x in request.args if x in allowed_args]) == 0:
|
||||
return {"error": "Missing valid args"}
|
||||
return {
|
||||
"error": "Missing valid args",
|
||||
"allowed": allowed_args
|
||||
}
|
||||
|
||||
for i in range(len(allowed_args)): # Gets the first valid argument and sets it as the method handler
|
||||
method = request.args.get(allowed_args[i])
|
||||
|
|
|
@ -4,7 +4,10 @@ allowed_args = ["file_hash", "file_version", "timestamp"]
|
|||
|
||||
def handle(request):
|
||||
if len([x for x in request.args if x in allowed_args]) == 0:
|
||||
return {"error": "Missing valid args"}
|
||||
return {
|
||||
"error": "Missing valid args",
|
||||
"allowed": allowed_args
|
||||
}
|
||||
|
||||
for i in range(len(allowed_args)): # Gets the first valid argument and sets it as the method handler
|
||||
method = request.args.get(allowed_args[i])
|
||||
|
|
Loading…
Reference in New Issue
Block a user