master
Aevann1 2022-01-21 13:18:33 +02:00
parent 68f0ff9a8a
commit 0679acba9b
1 changed files with 3 additions and 2 deletions

View File

@ -85,8 +85,6 @@ mail = Mail(app)
@app.before_request
def before_request():
print('first: ' + request.access_route[0])
print('second: ' + request.remote_addr)
if request.method.lower() != "get" and app.config["READ_ONLY"]:
return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500
@ -108,6 +106,9 @@ def teardown_request(error):
@app.after_request
def after_request(response):
print('first: ' + request.access_route[0])
print('second: ' + request.remote_addr)
response.headers.add("Strict-Transport-Security", "max-age=31536000")
response.headers.add("X-Frame-Options", "deny")
return response