Added base for zipper

This commit is contained in:
2018-05-24 12:22:16 +02:00
parent a4f91d5acf
commit 76e86ab94a
5 changed files with 76 additions and 2 deletions

17
handlers/getupdate.py Normal file
View File

@@ -0,0 +1,17 @@
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"}
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])
method_name = allowed_args[i]
if method is not None:
break
output = {
"search_method": method_name
}
output["endpoint"] = request.endpoint
return output