Rework error system a bit to remove a bunch of duplicated code (#434)
This commit is contained in:
parent
08602b4279
commit
0c632d73b7
28 changed files with 197 additions and 350 deletions
|
@ -161,10 +161,10 @@ def before_request():
|
|||
app.config['SETTINGS'] = json.load(f)
|
||||
|
||||
if request.host != app.config["SERVER_NAME"]:
|
||||
return {"error": "Unauthorized host provided."}, 401
|
||||
return {"error": "Unauthorized host provided."}, 403
|
||||
|
||||
if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"):
|
||||
abort(503)
|
||||
abort(403, "Bots are currently not allowed")
|
||||
|
||||
g.db = db_session()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue