forked from rDrama/rDrama
fix 500 error
parent
3ebea4f0bf
commit
e16ebf8749
|
@ -109,6 +109,10 @@ def before_request():
|
||||||
request.full_path = request.full_path.rstrip('?').rstrip('/')
|
request.full_path = request.full_path.rstrip('?').rstrip('/')
|
||||||
if not request.full_path: request.full_path = '/'
|
if not request.full_path: request.full_path = '/'
|
||||||
|
|
||||||
|
if not session.get("session_id"):
|
||||||
|
session.permanent = True
|
||||||
|
session["session_id"] = secrets.token_hex(49)
|
||||||
|
|
||||||
@app.after_request
|
@app.after_request
|
||||||
def after_request(response):
|
def after_request(response):
|
||||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||||
|
|
|
@ -63,11 +63,6 @@ def get_logged_in_user():
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
|
|
||||||
if not session.get("session_id"):
|
|
||||||
session.permanent = True
|
|
||||||
session["session_id"] = secrets.token_hex(49)
|
|
||||||
|
|
||||||
|
|
||||||
g.v = v
|
g.v = v
|
||||||
|
|
||||||
if v:
|
if v:
|
||||||
|
|
Loading…
Reference in New Issue