fix ratelimiting in wpd
parent
6250a75f00
commit
d217b3e843
|
@ -61,7 +61,7 @@ def get_CF():
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
x = request.headers.get('CF-Connecting-IP')
|
x = request.headers.get('CF-Connecting-IP')
|
||||||
if x: return x
|
if x: return x
|
||||||
return request.remote_addr
|
return request.headers.get('X-Forwarded-For')
|
||||||
|
|
||||||
limiter = Limiter(
|
limiter = Limiter(
|
||||||
app=app,
|
app=app,
|
||||||
|
|
|
@ -18,10 +18,6 @@ def get_ID():
|
||||||
else:
|
else:
|
||||||
x = "logged_out"
|
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}'
|
return f'{SITE}-{x}'
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ server {
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
include includes/headers;
|
include includes/headers;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://localhost:5000/;
|
proxy_pass http://localhost:5000/;
|
||||||
|
|
Loading…
Reference in New Issue