fsdsdf
This commit is contained in:
parent
3771573d39
commit
4a68cfc2f1
2 changed files with 6 additions and 7 deletions
|
@ -89,7 +89,8 @@ mail = Mail(app)
|
|||
@app.before_request
|
||||
def before_request():
|
||||
|
||||
if request.method.lower() != "get" and app.config["READ_ONLY"]: return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500
|
||||
if request.method.lower() != "get" and app.config["READ_ONLY"]:
|
||||
return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500
|
||||
|
||||
if app.config["BOT_DISABLE"] and request.headers.get("Authorization"): abort(503)
|
||||
|
||||
|
@ -101,12 +102,6 @@ def before_request():
|
|||
url = request.url.replace("http://", "https://", 1)
|
||||
return redirect(url, code=301)
|
||||
|
||||
g.system = 'desktop'
|
||||
ua = request.headers.get("User-Agent","")
|
||||
|
||||
for i in ('Version','Android','webOS','iPhone','iPad','iPod','BlackBerry','IEMobile','Opera Mini','Mobile','mobile','CriOS'):
|
||||
if i in ua: g.system = 'mobile'
|
||||
|
||||
@app.teardown_appcontext
|
||||
def teardown_request(error):
|
||||
if hasattr(g, 'db') and g.db:
|
||||
|
|
|
@ -33,6 +33,10 @@ tiers={
|
|||
"(Rich Bich)": 5,
|
||||
}
|
||||
|
||||
@app.get("/useragent")
|
||||
def useragent():
|
||||
return request.headers.get("User-Agent","")
|
||||
|
||||
@app.post("/settings/removebackground")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue