make ratelimiting work when not-proxied by cloudflare

pull/92/head
Aevann 2023-01-23 04:37:43 +02:00
parent d9056abfa8
commit 6c965d1c06
1 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,9 @@ if "load_chat" in argv:
def get_CF():
with app.app_context():
return request.headers.get('CF-Connecting-IP')
x = request.headers.get('CF-Connecting-IP')
if x: return x
return request.remote_addr
limiter = Limiter(
app=app,