Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(passthrough): protect accept-encoding from x-pass- forwarding

mateo-berri90493a217f06
diff --git a/litellm/passthrough/utils.py b/litellm/passthrough/utils.py
index 1572913f46e..df39b8fad48 100644
--- a/litellm/passthrough/utils.py
+++ b/litellm/passthrough/utils.py
@@ -18,6 +18,7 @@ _PASS_THROUGH_PROTECTED_HEADERS: Final[frozenset] = frozenset(
"x-goog-api-key",
"host",
"content-length",
+ "accept-encoding",
}
)
diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.py b/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.py
index 02464ad5caa..8e973fc3771 100644
--- a/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.py
+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.py
@@ -580,6 +580,7 @@ def test_forward_headers_never_forwards_client_accept_encoding():
request_headers = {
"accept-encoding": "gzip, deflate, br, zstd",
+ "x-pass-accept-encoding": "br",
"x-request-id": "req-123",
}