Remove quotes on qop and algorithm values for Digest auth #7184
+10
−4
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.
This fixes #5745
Motivation
The RFC7616 states the following for the Authorization header:
"For historical reasons, a sender MUST NOT generate the quoted string syntax for the following parameters: algorithm, qop, and nc."
The examples provided in the RFC also show that those parameters are unquoted.
Project history
I also found PR #1765 that intentionally quoted the
qopparameter but I believe the RFC was misinterpreted:RFC2617 defines the grammar for the Authorization header in chapter 3.2.2 as
message-qop = "qop" "=" qop-valueand theqop-valueis defined in chapter 3.2.1 asqop-value = "auth" | "auth-int" | token.Quotes in the grammar are used to indicate a raw string and should not be part of the final message.
The quoted part of the RFC in the linked PR is an extract from chapter 3.2.1 for the definition of
qop-optionswhich only affect theWWW-Authenticateheader sent by the server, not the client-sent response in theAuthorizationheader.