Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,7 @@ def predict(text, request: gr.Request):
|
|
8 |
|
9 |
if headers and 'x-forwarded-for' in headers:
|
10 |
x_forwarded_for = headers['x-forwarded-for']
|
11 |
-
real_client_ip = x_forwarded_for.split(
|
12 |
-
' ')[0] if x_forwarded_for else ""
|
13 |
|
14 |
return text, {"real_client_ip": real_client_ip,
|
15 |
"client_ip": client_ip,
|
|
|
8 |
|
9 |
if headers and 'x-forwarded-for' in headers:
|
10 |
x_forwarded_for = headers['x-forwarded-for']
|
11 |
+
real_client_ip = x_forwarded_for.split(' ')[0] if x_forwarded_for else ""
|
|
|
12 |
|
13 |
return text, {"real_client_ip": real_client_ip,
|
14 |
"client_ip": client_ip,
|