From 807c06504ff7e65b7d58176279adb653b99b0207 Mon Sep 17 00:00:00 2001 From: Sunpy Date: Thu, 31 May 2018 11:03:06 +0200 Subject: [PATCH] Pass allowed arguments into missing args error --- handlers/getfile.py | 5 ++++- handlers/getupdate.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/handlers/getfile.py b/handlers/getfile.py index df090e9..2ad60d7 100644 --- a/handlers/getfile.py +++ b/handlers/getfile.py @@ -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]) diff --git a/handlers/getupdate.py b/handlers/getupdate.py index 165a40a..f51fed0 100644 --- a/handlers/getupdate.py +++ b/handlers/getupdate.py @@ -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])