(
req: &mut hyper::http::request::Builder,
detected_headers: &HashSet<&str>,
)
| 418 | headers, |
| 419 | body, |
| 420 | &response_status, |
| 421 | initial_uri, |
| 422 | )?; |
| 423 | |
| 424 | let res = dispatch(ctx, client, req, abort_receiver).await?; |
| 425 | |
| 426 | let status = res.status(); |
| 427 | |
| 428 | // Per WHATWG Fetch §4.5 step 15.4: 421 on a non-GET/HEAD request retries once on a fresh connection. |
| 429 | if status.as_u16() == 421 && !matches!(method, Method::GET | Method::HEAD) { |
| 430 | drop(res); |
| 431 | // Force a new connection: open a new hyper client whose pool can't share TCP conns with the global one. |
| 432 | let new_client = llrt_http::build_client(None) |
| 433 | .or_throw_type(ctx, "Fetch failed: could not build retry client")?; |
| 434 | let (req, _) = build_request( |
| 435 | ctx, |
| 436 | &method, |
| 437 | uri, |
| 438 | headers, |
| 439 | body, |
no test coverage detected