Re-resolve system proxy routes across redirects (#34479)

## Why

Route-aware clients select a direct or proxy route from the complete request
URL. Letting `reqwest` follow redirects internally reuses the client chosen for
the original URL, so the redirect destination cannot receive its own PAC or
system proxy decision.

## What changed

- Follow redirects through `RouteAwareClientPool` when respecting the system
  proxy, resolving and caching a route for every hop.
- Preserve standard redirect method and body behavior, enforce one timeout
  across the request chain, and cap redirects at 10 hops.
- Strip origin-sensitive credentials and stale proxy authorization when the
  destination or selected route changes, and apply safe `Referer` handling.
- Log one final request outcome instead of intermediate redirect responses.

## Testing

Added an integration test covering a redirect from a direct route to a proxy
route, credential handling, and final-outcome logging.

GitOrigin-RevId: e5cb2cc962e99d33df61ef649465e956b92279bb
This commit is contained in:
Michael Bolin authored and copyberry committed 2026-07-21 07:18:18 +00:00
1 parent c04452a240
commit 841e47b8fb
7 files changed
+476 -24

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ mod error;
mod outbound_proxy;
mod request;
mod route_aware_client_pool;
mod route_aware_redirect;
mod transport;
pub use crate::chatgpt_cloudflare_cookies::with_chatgpt_cloudflare_cookie_store;