diff --git a/knot2/crates/knot-sim/tests/h3_private.rs b/knot2/crates/knot-sim/tests/h3_private.rs index 9b11ff379..2f5ef1026 100644 --- a/knot2/crates/knot-sim/tests/h3_private.rs +++ b/knot2/crates/knot-sim/tests/h3_private.rs @@ -728,3 +728,21 @@ async fn early_data_with_a_credential_is_refused_with_425_while_the_same_request after.close(); assert_eq!(early_answers, 12); } + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_first_request_after_a_full_handshake_is_never_called_early_data() { + let cove = cove().await; + let uri = cove.advert(&cove.hidden.did, "git-receive-pack"); + + // 16 stays under the pre-auth burst so a 429 can't hide a 425 + for attempt in 0..16 { + let mut session = H3Session::full_handshake(&cove.edge).await; + let (status, _, _) = session.send(Method::GET, &uri, &[], None).await; + session.close(); + assert_eq!( + status, + StatusCode::UNAUTHORIZED, + "connection {attempt}: an anonymous receive advertisement answers 401" + ); + } +}