fix ratelimiting in wpd

pull/116/head
Aevann 2023-02-09 10:11:34 +02:00
parent 6250a75f00
commit d217b3e843
3 changed files with 2 additions and 5 deletions

View File

@ -61,7 +61,7 @@ def get_CF():
with app.app_context():
x = request.headers.get('CF-Connecting-IP')
if x: return x
return request.remote_addr
return request.headers.get('X-Forwarded-For')
limiter = Limiter(
app=app,

View File

@ -18,10 +18,6 @@ def get_ID():
else:
x = "logged_out"
if x == 9:
print(f'{SITE}-{x}', flush=True)
print(request.headers.get('CF-Connecting-IP'), flush=True)
print(request.remote_addr, flush=True)
return f'{SITE}-{x}'

View File

@ -5,6 +5,7 @@ server {
listen [::]:80;
proxy_set_header Host $http_host;
include includes/headers;
proxy_set_header X-Forwarded-For $remote_addr;
location / {
proxy_pass http://localhost:5000/;