Skip to content

Proposed fix for #5888: preserve manually-set Proxy-Authorization on initial request#7615

Description

@aj-aura

Hi maintainers 馃憢

I prepared a minimal fix proposal for issue #5888 and would appreciate your review/feedback.

Problem statement

In the current behavior discussed in #5888, a manually-set Proxy-Authorization header may be removed too aggressively, including the initial request path in some flows.

Proposed behavior

  • Preserve manually-set Proxy-Authorization on the initial request path.
  • Keep stripping behavior on redirect/proxy-change paths where rebuilding proxy auth is expected.

Implementation scope

I kept the patch intentionally small and focused:

  • requests/sessions.py
  • tests/test_5888_regression.py (new regression tests)

What tests cover

  • initial non-redirect request preserves manually-set Proxy-Authorization
  • redirect/proxy-change path strips header as expected
  • no regression in related auth/header interaction

Patch branch

I cannot open a direct PR due to repository permission restrictions, so I鈥檓 sharing the branch here:

If this direction looks good, I can adjust the patch immediately based on maintainer guidance.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions