Retry bootstrap GETs through the system proxy after request failures (#52702)

## Why

Account discovery and cloud configuration GETs can fail after connecting but before receiving response headers. These request failures previously bypassed system proxy fallback.

## What changed

Allow bootstrap GETs to retry through the system proxy on request errors, alongside the existing connection failure and timeout cases, when fallback is enabled.

## Testing

Add regression coverage for connections closed before response headers on `accounts/check` and `config/bundle`, verifying successful proxy retries with the original request headers. Extend coverage to ensure HTTP responses with status `401`, `403`, `407`, `429`, or `503` do not trigger fallback, and network policy denials prevent requests to both the origin and proxy.

GitOrigin-RevId: ac34c3bcfe3bd81c905a7e616d8b821879fbe2c9
This commit is contained in:
Abhinav
2026-10-09 21:29:36 +00:00
committed by copyberry
parent 0c22ce8f2e
commit 4bc83aa5f7
2 changed files with 93 additions and 3 deletions
+3 -1
View File
@@ -360,7 +360,9 @@ impl Client {
Ok(Err(RequestError::Other(error)))
if error
.downcast_ref::<RouteAwareRequestError>()
.is_some_and(|error| error.is_connect() || error.is_timeout()) => {}
.is_some_and(|error| {
error.is_connect() || error.is_timeout() || error.is_request()
}) => {}
Err(_) => {}
Ok(response) => return response,
}