This commit is contained in:
Aevann1 2022-01-22 17:55:34 +02:00
parent 914969c9d3
commit 4858a1b0a9
2 changed files with 128 additions and 43 deletions

View file

@ -94,9 +94,15 @@ def before_request():
g.timestamp = int(time.time())
if '; wv) ' in request.headers.get("User-Agent",""): g.webview = True
ua = request.headers.get("User-Agent","").lower()
if '; wv) ' in ua: g.webview = True
else: g.webview = False
if 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/': g.seal = True
else: g.seal = False
@app.teardown_appcontext
def teardown_request(error):
if hasattr(g, 'db') and g.db: