From 7fbdc9a38debd72339011e68ffdb671dfddee410 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 3 Nov 2026 13:00:38 +0900 Subject: [PATCH] test(gateway): read the many-header response with the raw client The hyper test client has the same 100-header default the fix lifts, so it rejected the relayed response itself Co-Authored-By: Claude Opus 5.5 --- .../crates/gateway-forward/tests/http.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/litellm-rust/crates/gateway-forward/tests/http.rs b/litellm-rust/crates/gateway-forward/tests/http.rs index 3714a111b75..78de426f521 100644 --- a/litellm-rust/crates/gateway-forward/tests/http.rs +++ b/litellm-rust/crates/gateway-forward/tests/http.rs @@ -183,19 +183,14 @@ async fn relays_a_response_with_more_headers_than_hyper_allows_by_default() { })) .await; let gateway = Gateway::start(upstream).await; + let mut raw = gateway.connect().await; - let response = within( - client().request( - axum::http::Request::get(gateway.url("/v1/chat/completions")) - .body(Body::empty()) - .unwrap(), - ), - ) - .await - .unwrap(); + raw.send("GET /v1/chat/completions HTTP/1.1\r\nhost: public.example\r\n\r\n") + .await; - assert_eq!(response.status(), StatusCode::OK); - assert_eq!(response.headers()["llm_provider-x-149"], "v"); + let head = within(raw.response_head()).await.unwrap(); + assert_eq!(head.status, StatusCode::OK); + assert_eq!(head.header("llm_provider-x-149"), Some(&b"v"[..])); } #[rstest]