Repository navigation
Parse the Digest Authorization header as specified by RFC 9110 - #1109
Merged
markt-asf merged 1 commit intoNov 17, 2026
Merged
Conversation
markt-asf
requested changes
Nov 4, 2026
The authentication scheme and the parameter names are case-insensitive (sections 11.1 and 11.2) and a recipient must ignore empty list elements (section 5.6.1.2). The parser matched "Digest" case-sensitively, kept the parameter names as received, so a name such as "Username" was never found, and rejected a list with an empty element. Match the scheme as a token, lower case the parameter names and skip the empty elements.
arturobernalg
force-pushed
the
rfc9110-digest-credentials-parsing
branch
from
November 4, 2026 15:38
ac5639d to
76b6fb9
Compare
Member
Author
|
@markt-asf Addressed both comments and added regression tests. Could you take another look? |
markt-asf
added a commit
that referenced
this pull request
Nov 17, 2026
Add a change log entry Update RFC references Correct digest parameter from "digest-uri" to "uri"
markt-asf
pushed a commit
that referenced
this pull request
Nov 17, 2026
The authentication scheme and the parameter names are case-insensitive (sections 11.1 and 11.2) and a recipient must ignore empty list elements (section 5.6.1.2). The parser matched "Digest" case-sensitively, kept the parameter names as received, so a name such as "Username" was never found, and rejected a list with an empty element. Match the scheme as a token, lower case the parameter names and skip the empty elements.
markt-asf
pushed a commit
that referenced
this pull request
Nov 17, 2026
The authentication scheme and the parameter names are case-insensitive (sections 11.1 and 11.2) and a recipient must ignore empty list elements (section 5.6.1.2). The parser matched "Digest" case-sensitively, kept the parameter names as received, so a name such as "Username" was never found, and rejected a list with an empty element. Match the scheme as a token, lower case the parameter names and skip the empty elements.
markt-asf
pushed a commit
that referenced
this pull request
Nov 17, 2026
The authentication scheme and the parameter names are case-insensitive (sections 11.1 and 11.2) and a recipient must ignore empty list elements (section 5.6.1.2). The parser matched "Digest" case-sensitively, kept the parameter names as received, so a name such as "Username" was never found, and rejected a list with an empty element. Match the scheme as a token, lower case the parameter names and skip the empty elements.
markt-asf
added a commit
that referenced
this pull request
Nov 17, 2026
Add a change log entry Update RFC references Correct digest parameter from "digest-uri" to "uri"
markt-asf
added a commit
that referenced
this pull request
Nov 17, 2026
Add a change log entry Update RFC references Correct digest parameter from "digest-uri" to "uri"
markt-asf
added a commit
that referenced
this pull request
Nov 17, 2026
Add a change log entry Update RFC references Correct digest parameter from "digest-uri" to "uri"
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.
Authorization.parseAuthorizationDigestdoes not follow RFC 9110 in three ways.The authentication scheme is case-insensitive (section 11.1), but "Digest" was matched case-sensitively, so a request with
digest username="a", ...was rejected and got a 401 response. The parameter names are case-insensitive (section 11.2): the parser looked up the field type with a lower case name but stored the name as received, soUsername="a"was never found byDigestAuthenticator. A recipient must parse and ignore empty list elements (section 5.6.1.2), butDigest username="a",, realm="r"was rejected.This change reads the scheme as a token and compares it ignoring case, lower cases the parameter names and skips the empty elements. As a side effect
Digestusername="a", which was accepted by accident, is now rejected.TestAuthorizationDigest has four new tests. They fail without the change and pass with it, and the other
TestDigestAuthenticator*classes and TestBasicAuthParser still pass.