abidlabs HF staff commited on
Commit
ca0c672
1 Parent(s): c04afa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -5
app.py CHANGED
@@ -86,11 +86,6 @@ def allow_ip(request: gr.Request, show_error=True):
86
  ip = request.headers.get("X-Forwarded-For")
87
  now = datetime.now()
88
  window = timedelta(hours=24)
89
-
90
- ip = request.client.host
91
- now = datetime.now()
92
- window = timedelta(hours=24)
93
-
94
  with ip_requests_lock:
95
  if ip in ip_requests:
96
  ip_requests[ip] = [timestamp for timestamp in ip_requests[ip] if now - timestamp < window]
 
86
  ip = request.headers.get("X-Forwarded-For")
87
  now = datetime.now()
88
  window = timedelta(hours=24)
 
 
 
 
 
89
  with ip_requests_lock:
90
  if ip in ip_requests:
91
  ip_requests[ip] = [timestamp for timestamp in ip_requests[ip] if now - timestamp < window]