From 3120ec44d4b3f8d7ca7df67ea7335a2cc0004c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Da=CC=81vid=20Istva=CC=81n=20Bi=CC=81ro=CC=81?= Date: Tue, 15 Sep 2026 14:09:59 +0200 Subject: [PATCH] test(http): drain header-echo requests before replying --- tests/common/test_server.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/common/test_server.rs b/tests/common/test_server.rs index c923fece..0d90865b 100644 --- a/tests/common/test_server.rs +++ b/tests/common/test_server.rs @@ -189,7 +189,9 @@ pub async fn start_test_server() -> (u16, TestServerHandle) { ) .route( "/echo-referer", - post(async move |headers: HeaderMap| { + post(async move |headers: HeaderMap, _body: Bytes| { + // This endpoint tests request-header policy, not early responses. Consume the + // request body before replying so response delivery cannot race body completion. let referer = headers .get("referer") .and_then(|h| h.to_str().ok()) @@ -202,7 +204,9 @@ pub async fn start_test_server() -> (u16, TestServerHandle) { ) .route( "/echo-credentials", - post(async move |headers: HeaderMap| { + post(async move |headers: HeaderMap, _body: Bytes| { + // Like /echo-referer, keep the fixture focused on header semantics by + // consuming the request body before constructing the response. let authorization = headers .get("authorization") .and_then(|h| h.to_str().ok())