fds
This commit is contained in:
parent
42d0abe810
commit
fea2682c6c
1 changed files with 5 additions and 1 deletions
|
@ -19,6 +19,10 @@ from sys import stdout
|
||||||
import faulthandler
|
import faulthandler
|
||||||
import atexit
|
import atexit
|
||||||
|
|
||||||
|
def get_CF() -> str:
|
||||||
|
with app.app_context():
|
||||||
|
return request.headers.get('CF-Connecting-IP')
|
||||||
|
|
||||||
app = Flask(__name__, template_folder='templates')
|
app = Flask(__name__, template_folder='templates')
|
||||||
app.url_map.strict_slashes = False
|
app.url_map.strict_slashes = False
|
||||||
app.jinja_env.cache = {}
|
app.jinja_env.cache = {}
|
||||||
|
@ -65,7 +69,7 @@ r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_respons
|
||||||
|
|
||||||
limiter = Limiter(
|
limiter = Limiter(
|
||||||
app,
|
app,
|
||||||
key_func=request.headers.get('CF-Connecting-IP'),
|
key_func=,
|
||||||
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")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue