mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
Fix potential header issue
This commit is contained in:
parent
fcb16d91af
commit
7fd02e7d56
1 changed files with 4 additions and 1 deletions
|
|
@ -348,7 +348,10 @@ class HiddenlayerGuardrailV2(CustomGuardrail):
|
|||
|
||||
# put our roundtrip id in the header to the model so we get it on the way back from the model
|
||||
if "hl-roundtrip-id" not in headers:
|
||||
request_data["proxy_server_request"]["headers"]["hl-roundtrip-id"] = str(uuid4())
|
||||
proxy_req = request_data.get("proxy_server_request")
|
||||
if proxy_req is not None and "headers" in proxy_req:
|
||||
proxy_req["headers"]["hl-roundtrip-id"] = str(uuid4())
|
||||
headers["hl-roundtrip-id"] = proxy_req["headers"]["hl-roundtrip-id"]
|
||||
|
||||
hl_headers = {h.lower():v for h,v in headers.items() if h.lower().startswith("hl-")}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue