mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix _get_request_ip_address
This commit is contained in:
parent
8e7bcb42a6
commit
cae51fc7fc
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue