vcxxvc
This commit is contained in:
parent
914969c9d3
commit
4858a1b0a9
2 changed files with 128 additions and 43 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue