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