paola1 commited on
Commit
027e365
·
verified ·
1 Parent(s): c346bf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -90,7 +90,9 @@ async def create_auto_user_entry(
90
  """
91
  try:
92
  # Automatically extract the client's IP address
93
- ip_address = request.client.host
 
 
94
 
95
  # If timestamp is not provided, use the current time
96
  if not timestamp:
 
90
  """
91
  try:
92
  # Automatically extract the client's IP address
93
+ client_ip = request.client.host
94
+ if "x-forwarded-for" in request.headers:
95
+ client_ip = request.headers["x-forwarded-for"].split(",")[0]
96
 
97
  # If timestamp is not provided, use the current time
98
  if not timestamp: