Skip to content

test: verify proxy authorization is stripped on redirects - #3119

Open
renanmpimentel wants to merge 1 commit into
seanmonstar:masterfrom
renanmpimentel:test/proxy-authorization-redirect-stripping
Open

renanmpimentel wants to merge 1 commit into
seanmonstar:masterfrom
renanmpimentel:test/proxy-authorization-redirect-stripping

Conversation

@renanmpimentel

Copy link
Copy Markdown

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_headers intentionally strips proxy credentials when the destination changes, but the existing tests only assert the behavior for Authorization and Cookie. Removing its PROXY_AUTHORIZATION removal 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:

State Result
Existing suite + removal omitted 118 passed, 3 ignored
Updated tests + same regression 2 assertion failures; proxy-authorization remains in the header map
Updated tests + correct implementation Both affected tests pass

The permanent diff changes tests only.

Verification

  • cargo fmt --check: passed
  • cargo check --all-targets: passed
  • cargo test --tests --lib --quiet: 118 passed, 3 ignored
  • git diff --check: passed

An additional cargo clippy --all-targets -- -D warnings run reports existing lints in unchanged files such as src/error.rs, src/proxy.rs, and src/util.rs with Rust 1.90; the repository CI does not run Clippy.

Found while auditing test effectiveness with Supertest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant