libokj commited on
Commit
4a4216c
·
verified ·
1 Parent(s): d558a8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ def ts_to_str(timestamp, timezone):
17
 
18
  def predict(text, request: gr.Request):
19
  # Get the IP address from the request object
20
- ip_address = request.client.host
21
 
22
  # Call the WorldTimeAPI to get the timezone for the user's IP address
23
  response = requests.get(f'https://worldtimeapi.org/api/ip/{ip_address}')
 
17
 
18
  def predict(text, request: gr.Request):
19
  # Get the IP address from the request object
20
+ ip_address = request.headers.get('x-forwarded-for', request.client.host)
21
 
22
  # Call the WorldTimeAPI to get the timezone for the user's IP address
23
  response = requests.get(f'https://worldtimeapi.org/api/ip/{ip_address}')