Repository navigation
test: verify proxy authorization is stripped on redirects - #3119
Open
renanmpimentel wants to merge 1 commit into
Open
renanmpimentel wants to merge 1 commit into
renanmpimentel wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the existing redirect header tests to include
Proxy-Authorization. They now check that the header is retained for a same-origin redirect and removed for a cross-host redirect or an HTTPS-to-HTTP downgrade.Why
remove_sensitive_headersintentionally strips proxy credentials when the destination changes, but the existing tests only assert the behavior forAuthorizationandCookie. Removing itsPROXY_AUTHORIZATIONremoval leaves the complete default-feature suite green (118 passed, 3 ignored), allowing credentials to remain in the redirected request's headers.I verified the gap with that regression in a disposable worktree:
proxy-authorizationremains in the header mapThe permanent diff changes tests only.
Verification
cargo fmt --check: passedcargo check --all-targets: passedcargo test --tests --lib --quiet: 118 passed, 3 ignoredgit diff --check: passedAn additional
cargo clippy --all-targets -- -D warningsrun reports existing lints in unchanged files such assrc/error.rs,src/proxy.rs, andsrc/util.rswith Rust 1.90; the repository CI does not run Clippy.Found while auditing test effectiveness with Supertest.