Bad action increment on invalid file update request

This commit is contained in:
shortcutme 2017-02-09 01:54:04 +01:00
parent 38d330da1a
commit 277d16eabb
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -92,10 +92,12 @@ class FileRequest(object):
site = self.sites.get(params["site"])
if not site or not site.settings["serving"]: # Site unknown or not serving
self.response({"error": "Unknown site"})
self.connection.badAction(1)
return False
if not params["inner_path"].endswith("content.json"):
self.response({"error": "Only content.json update allowed"})
self.connection.badAction(5)
return
content = json.loads(params["body"])