Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@app.route("/api/upgrade-check", methods=["POST"])
@app.route("/api/upgrade-check/", methods=["GET"])
def api_upgrade_check(request_hash=None):
if request.method == "POST":
try:
request_json = json.loads(request.get_data().decode("utf-8"))
except json.JSONDecodeError:
return "[]", HTTPStatus.BAD_REQUEST
else:
if not request_hash:
return "[]", HTTPStatus.BAD_REQUEST
request_json = {"request_hash": request_hash}
return uc.process_request(request_json)
@app.route("/api/image/")
def api_image(image_hash):
return mime_json(database.get_image_info(image_hash))
@app.cli.command()
def resetdb():
"""Reset database"""
database.reset_db()