markt-asf commented on code in PR #1109:
URL: https://github.com/apache/tomcat/pull/1109#discussion_r4469219745
##########
java/org/apache/tomcat/util/http/parser/Authorization.java:
##########
@@ -74,9 +74,14 @@ public static Map<String,String>
parseAuthorizationDigest(StringReader input)
Map<String,String> result = new HashMap<>();
- if (HttpParser.skipConstant(input, "Digest") != SkipResult.FOUND) {
+ // The authentication scheme is case-insensitive (RFC 9110, section
11.1)
+ if (!"Digest".equalsIgnoreCase(HttpParser.readToken(input))) {
return null;
}
+ // Empty list elements must be ignored (RFC 9110, section 5.6.1.2)
Review Comment:
The RFC requires 1*SP after auth-scheme
##########
java/org/apache/tomcat/util/http/parser/Authorization.java:
##########
@@ -101,11 +106,17 @@ public static Map<String,String>
parseAuthorizationDigest(StringReader input)
if (value == null) {
return null;
}
- result.put(field, value);
+ // The parameter names are case-insensitive (RFC 9110, section
11.2)
+ result.put(field.toLowerCase(Locale.ENGLISH), value);
Review Comment:
Duplicates here should trigger a failure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]