From c39a4e2f615c8de88f1fcc7147f527dca6bb4bab Mon Sep 17 00:00:00 2001 From: aaldebs99 Date: Sun, 12 Oct 2025 03:29:10 +0000 Subject: [PATCH] fix(tests): race condition --- tests/integration_oidc_tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_oidc_tests.rs b/tests/integration_oidc_tests.rs index 7dc357a..f835d74 100644 --- a/tests/integration_oidc_tests.rs +++ b/tests/integration_oidc_tests.rs @@ -339,6 +339,9 @@ mod tests { let status = response.status(); + // Extract headers before consuming response + let headers = response.headers().clone(); + if status != StatusCode::SEE_OTHER { let body = axum::body::to_bytes(response.into_body(), usize::MAX) .await @@ -364,7 +367,7 @@ mod tests { assert_eq!(status, StatusCode::SEE_OTHER); // Extract the token from the Location header - let location = response.headers().get("location").unwrap().to_str().unwrap(); + let location = headers.get("location").unwrap().to_str().unwrap(); assert!(location.contains("/auth/callback?token=")); // Extract token from URL