@@ -31,22 +31,20 @@ public class Authorization {
3131
3232 static {
3333 // Digest field types.
34- // Note: These are more relaxed than RFC2617. This adheres to the
35- // recommendation of RFC2616 that servers are tolerant of buggy
36- // clients when they can be so without ambiguity.
34+ // Note: These are more relaxed than RFC 7616 without introducing ambiguities
3735 fieldTypes .put ("username" , FieldType .QUOTED_STRING );
3836 fieldTypes .put ("realm" , FieldType .QUOTED_STRING );
3937 fieldTypes .put ("nonce" , FieldType .QUOTED_STRING );
40- fieldTypes .put ("digest- uri" , FieldType .QUOTED_STRING );
41- // RFC2617 says response is <">32LHEX<">. 32LHEX will also be accepted
38+ fieldTypes .put ("uri" , FieldType .QUOTED_STRING );
39+ // RFC 7616 says response is quoted lower case hex. unquoted will also be accepted
4240 fieldTypes .put ("response" , FieldType .LHEX );
43- // RFC2617 says algorithm is token. <">token<"> will also be accepted
41+ // RFC 7616 says algorithm is token. <">token<"> will also be accepted
4442 fieldTypes .put ("algorithm" , FieldType .QUOTED_TOKEN );
4543 fieldTypes .put ("cnonce" , FieldType .QUOTED_STRING );
4644 fieldTypes .put ("opaque" , FieldType .QUOTED_STRING );
47- // RFC2617 says qop is token. <">token<"> will also be accepted
45+ // RFC 7616 says qop is token. <">token<"> will also be accepted
4846 fieldTypes .put ("qop" , FieldType .QUOTED_TOKEN );
49- // RFC2617 says nc is 8LHEX. <">8LHEX<"> will also be accepted
47+ // RFC 7616 says nc is 8LHEX. <">8LHEX<"> will also be accepted
5048 fieldTypes .put ("nc" , FieldType .LHEX );
5149
5250 }
@@ -58,15 +56,15 @@ private Authorization() {
5856
5957
6058 /**
61- * Parses an HTTP Authorization header for DIGEST authentication as per RFC 2617 section 3.2.2 .
59+ * Parses an HTTP Authorization header for DIGEST authentication as per RFC 7616 section 3.4 .
6260 *
6361 * @param input The header value to parse
6462 *
6563 * @return A map of directives and values as {@link String}s or <code>null</code> if a parsing error occurs.
6664 * Although the values returned are {@link String}s they will have been validated to ensure that they
67- * conform to RFC 2617 .
65+ * conform to RFC 7616 .
6866 *
69- * @throws IllegalArgumentException If the header does not conform to RFC 2617
67+ * @throws IllegalArgumentException If the header does not conform to RFC 7616
7068 * @throws IOException If an error occurs while reading the input
7169 */
7270 public static Map <String ,String > parseAuthorizationDigest (StringReader input )
0 commit comments