Merge branch 'main' into litellm_fix_azure_api_version

This commit is contained in:
Krish Dholakia 2024-08-20 11:40:53 -07:00 committed by GitHub
commit 409306b266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 490 additions and 103 deletions

View file

@ -1269,8 +1269,9 @@ def _get_user_role(
def _get_request_ip_address(
request: Request, use_x_forwarded_for: Optional[bool] = False
) -> str:
) -> Optional[str]:
client_ip = None
if use_x_forwarded_for is True and "x-forwarded-for" in request.headers:
client_ip = request.headers["x-forwarded-for"]
elif request.client is not None: