fix auth remote addr access (#15378)

This commit is contained in:
Nicolas Mowen 2024-12-06 10:25:43 -06:00 committed by GitHub
parent 8aa6297308
commit bb86e71e65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,12 @@ def get_remote_addr(request: Request):
return str(ip) return str(ip)
# if there wasn't anything in the route, just return the default # if there wasn't anything in the route, just return the default
return request.remote_addr or "127.0.0.1" remote_addr = None
if hasattr(request, "remote_addr"):
remote_addr = request.remote_addr
return remote_addr or "127.0.0.1"
def get_jwt_secret() -> str: def get_jwt_secret() -> str: