litellm/tests/unit/proxy/middleware
kenneth-berri 66b923b51d
feat(proxy): let operators omit x-litellm-* response headers (#52949)
* feat(proxy): optionally omit LiteLLM response headers across HTTP paths

Signed-off-by: Jaeyeon Kim <anencore94@gmail.com>

* fix(proxy): preserve typed headers without rebinding messages

Signed-off-by: Jaeyeon Kim <anencore94@gmail.com>

* refactor(proxy): inject the header opt-out setting into the middleware

* fix(proxy): apply the header opt-out to unhandled 500 responses

The unhandled exception handler runs outside the middleware stack, so its x-litellm-call-id header was not filtered. Also type the middleware test.

* refactor(proxy): share one typed header opt-out check

A named function replaces the lambda so the type gate stays at its merge-base count, and the 500 handler filters raw headers in place.

---------

Signed-off-by: Jaeyeon Kim <anencore94@gmail.com>
Co-authored-by: Jaeyeon Kim <anencore94@gmail.com>
2026-11-19 15:27:34 -08:00
..
__init__.py
test_admission_control_middleware.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
test_billable_request_metrics_middleware.py feat(proxy): add OpenSearch index pass-through with per-key read/write grants (#50573) 2026-11-09 18:54:20 +00:00
test_budget_reservation_release_middleware.py feat(budgets): replace the python budget hold and settle engine with a rust engine admitted at auth (#51535) 2026-11-15 16:03:51 -08:00
test_gzip_middleware.py fix(proxy): limit gzip to dashboard analytics and offload compression (#46712) 2026-10-15 17:27:03 -07:00
test_in_flight_requests_middleware.py
test_litellm_response_headers_middleware.py feat(proxy): let operators omit x-litellm-* response headers (#52949) 2026-11-19 15:27:34 -08:00
test_per_request_root_path_middleware.py
test_prometheus_auth_middleware.py
test_prometheus_auth_middleware_asgi.py
test_request_body_decompression_middleware.py feat(skills): let authors edit and withdraw pending submissions (#51312) 2026-11-12 08:30:10 -08:00
test_request_size_limit_middleware.py feat(skills): let authors edit and withdraw pending submissions (#51312) 2026-11-12 08:30:10 -08:00
test_security_headers_middleware.py