Skip to content

[3.14] gh-53089: Send uri="/" in Digest auth for URLs with an empty path (GH-161009) - #161014

Merged
orsenthil merged 1 commit into
python:3.14from
miss-islington:backport-663e99d-3.14
Oct 31, 2026
Merged

orsenthil merged 1 commit into
python:3.14from
miss-islington:backport-663e99d-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

For a URL such as http://example.com, the request selector is empty.
AbstractDigestAuthHandler.get_authorization() used it as-is, sending
uri="" and hashing "GET:" while http.client sends "GET /" on the
request line, so servers rejected the request or failed the digest
check. Normalize an empty selector to '/', as http.client does, for
both the uri field and A2.

Also replace the long-standing "XXX selector: what about proxies and
full urls" note with a comment explaining that the digest-uri is the
request-target as sent (absolute-form through an HTTP proxy), which
RFC 7616 allows, and add a test pinning that behavior.
(cherry picked from commit 663e99d)

Co-authored-by: Senthil Kumaran senthil@python.org
Co-authored-by: Claude Opus 5.5 noreply@anthropic.com

…th (pythonGH-161009)

For a URL such as http://example.com, the request selector is empty.
AbstractDigestAuthHandler.get_authorization() used it as-is, sending
uri="" and hashing "GET:" while http.client sends "GET /" on the
request line, so servers rejected the request or failed the digest
check.  Normalize an empty selector to '/', as http.client does, for
both the uri field and A2.

Also replace the long-standing "XXX selector: what about proxies and
full urls" note with a comment explaining that the digest-uri is the
request-target as sent (absolute-form through an HTTP proxy), which
RFC 7616 allows, and add a test pinning that behavior.
(cherry picked from commit 663e99d)

Co-authored-by: Senthil Kumaran <senthil@python.org>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@orsenthil
orsenthil enabled auto-merge (squash) October 31, 2026 16:01
@orsenthil
orsenthil merged commit b78dacc into python:3.14 Oct 31, 2026
54 of 55 checks passed
@miss-islington
miss-islington deleted the backport-663e99d-3.14 branch October 31, 2026 16:26
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.

2 participants