From 504115133a670b0c93bf73a555a31b6fff201a2e Mon Sep 17 00:00:00 2001 From: meat-daemon-404 <3335264558@qq.com> Date: Fri, 27 Nov 2026 19:06:49 +0800 Subject: [PATCH] docs: document Authorization header stripping on cross-origin redirects Document in docs/quickstart.md that HTTPX strips the Authorization header when following redirects to a different origin, except for direct HTTP to HTTPS redirects to the same host and default port (matching BaseClient._redirect_headers). Fixes #3334 --- docs/quickstart.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/quickstart.md b/docs/quickstart.md index e140b53cd7..fd16847d7a 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -448,6 +448,10 @@ The `history` property of the response can be used to inspect any followed redir It contains a list of any redirect responses that were followed, in the order in which they were made. +When following a redirect to a different origin (scheme, host, or port), HTTPX +automatically strips the `Authorization` header to avoid leaking credentials, +except for direct HTTP to HTTPS redirects to the same host and default port. + ## Timeouts HTTPX defaults to including reasonable timeouts for all network operations,