fds
This commit is contained in:
parent
27187a4f2f
commit
42d0abe810
1 changed files with 1 additions and 6 deletions
|
@ -65,7 +65,7 @@ r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_respons
|
||||||
|
|
||||||
limiter = Limiter(
|
limiter = Limiter(
|
||||||
app,
|
app,
|
||||||
key_func=get_ipaddr,
|
key_func=request.headers.get('CF-Connecting-IP'),
|
||||||
default_limits=["3/second;30/minute;200/hour;1000/day"],
|
default_limits=["3/second;30/minute;200/hour;1000/day"],
|
||||||
application_limits=["10/second;200/minute;5000/hour;10000/day"],
|
application_limits=["10/second;200/minute;5000/hour;10000/day"],
|
||||||
storage_uri=environ.get("REDIS_URL", "redis://localhost")
|
storage_uri=environ.get("REDIS_URL", "redis://localhost")
|
||||||
|
@ -104,11 +104,6 @@ def teardown_request(error):
|
||||||
|
|
||||||
@app.after_request
|
@app.after_request
|
||||||
def after_request(response):
|
def after_request(response):
|
||||||
|
|
||||||
print('first: ' + request.access_route[0])
|
|
||||||
print('second: ' + request.remote_addr)
|
|
||||||
print('third: ' + request.headers.get('CF-Connecting-IP'))
|
|
||||||
|
|
||||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||||
response.headers.add("X-Frame-Options", "deny")
|
response.headers.add("X-Frame-Options", "deny")
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue