radames commited on
Commit
7c187ce
1 Parent(s): 0ec3795

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -7,11 +7,10 @@ def predict(text, request: gr.Request):
7
  headers = request.kwargs['headers']
8
  if headers and 'x-forwarded-for' in headers:
9
  x_forwarded_for = headers['x-forwarded-for']
10
- real_client_ip = x_forwarded_for.split(' ')[0] if x_forwarded_for else ""
11
 
12
- print("real_client_ip", real_client_ip, "client_ip", client_ip, text, "\n\n")
13
- return text, {"real_client_ip": real_client_ip,
14
- "client_ip": client_ip,
15
  "local_ip": local_ip,
16
  "headers": headers}
17
 
 
7
  headers = request.kwargs['headers']
8
  if headers and 'x-forwarded-for' in headers:
9
  x_forwarded_for = headers['x-forwarded-for']
10
+ client_ip = x_forwarded_for.split(' ')[0] if x_forwarded_for else ""
11
 
12
+ print("client_ip", client_ip, text, "\n\n")
13
+ return text, {"client_ip": client_ip,
 
14
  "local_ip": local_ip,
15
  "headers": headers}
16