abidlabs HF staff commited on
Commit
9324678
·
verified ·
1 Parent(s): e93e599

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -83,10 +83,10 @@ ip_requests = {}
83
  ip_requests_lock = threading.Lock()
84
 
85
  def allow_ip(request: gr.Request, show_error=True):
86
- print(request)
87
- print(request.client)
88
- print(request.headers)
89
- print(request.headers.get("X-Forwarded-For"), request.headers.get("X-Real-IP"))
90
  ip = request.client.host
91
  now = datetime.now()
92
  window = timedelta(hours=24)
 
83
  ip_requests_lock = threading.Lock()
84
 
85
  def allow_ip(request: gr.Request, show_error=True):
86
+ ip = request.headers.get("X-Forwarded-For", request.client.host)
87
+ now = datetime.now()
88
+ window = timedelta(hours=24)
89
+
90
  ip = request.client.host
91
  now = datetime.now()
92
  window = timedelta(hours=24)