mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(litellm_pre_call_utils.py): handle no query params in request
This commit is contained in:
parent
1170b3a510
commit
a85a932e25
2 changed files with 8 additions and 4 deletions
|
@ -1275,6 +1275,8 @@ def _get_request_ip_address(
|
|||
client_ip = request.headers["x-forwarded-for"]
|
||||
elif request.client is not None:
|
||||
client_ip = request.client.host
|
||||
else:
|
||||
client_ip = ""
|
||||
|
||||
return client_ip
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue