ok2c commented on code in PR #510:
URL: 
https://github.com/apache/httpcomponents-client/pull/510#discussion_r1413038237


##########
httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java:
##########
@@ -746,4 +746,25 @@ public void testSerialization() throws Exception {
         Assertions.assertEquals(digestScheme.getCnonce(), 
authScheme.getCnonce());
     }
 
+
+    @Test
+    public void testErrorOnBothUsernameAndUsernameStar() throws Exception {
+        final ClassicHttpRequest request = new BasicClassicHttpRequest("Post", 
"/");
+        request.setEntity(new InputStreamEntity(new ByteArrayInputStream(new 
byte[] {'a'}), -1, ContentType.DEFAULT_TEXT));
+        final HttpHost host = new HttpHost("somehost", 80);
+        final CredentialsProvider credentialsProvider = 
CredentialsProviderBuilder.create()
+                .add(new AuthScope(host, "realm1", null), "username", 
"password".toCharArray())
+                .build();
+
+        final String challenge = StandardAuthScheme.DIGEST + " 
realm=\"realm1\", nonce=\"f2a3f18799759d4f1a1c068b92b573cb\", " +

Review Comment:
   @arturobernalg Please note this scenario is not very practical. The 
`username` and `username*` parameters apply to an auth response, not to an auth 
challenge. 
   I approved the change-set but in all honesty the check is not very useful.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to