Skip to content

Preserve semicolons in digest auth URI#7332

Open
monsonego wants to merge 1 commit intopsf:mainfrom
monsonego:fix-digest-uri-semicolon-path
Open

Preserve semicolons in digest auth URI#7332
monsonego wants to merge 1 commit intopsf:mainfrom
monsonego:fix-digest-uri-semicolon-path

Conversation

@monsonego
Copy link
Copy Markdown

@monsonego monsonego commented Apr 5, 2026

Summary

Preserve semicolon-delimited path parameters when Requests builds the digest-auth uri field.

Closes #6990.

Problem

HTTPDigestAuth.build_digest_header() currently rebuilds the request URI from the parsed path and query string only.

For URLs whose path includes semicolon-delimited parameters, that drops part of the original request target before Requests hashes it into the Authorization header.

Changes

  • append urlparse(url).params back onto the digest-auth path before adding the query string
  • add a regression test that covers a digest-auth URL whose path contains semicolon parameters

Testing

  • PYTHONPATH=src python -m pytest tests/test_requests.py -k digestauth -q

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.

uri field of digest authentication incorrectly filled when the URL contains semicolons in path

1 participant