michael-o commented on code in PR #399:
URL: 
https://github.com/apache/httpcomponents-client/pull/399#discussion_r1045837033


##########
httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/BasicAuthenticationHandler.java:
##########
@@ -27,13 +27,27 @@
 
 package org.apache.hc.client5.testing.auth;
 
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
 import org.apache.hc.client5.http.auth.StandardAuthScheme;
 import org.apache.hc.client5.http.utils.Base64;
 
 public class BasicAuthenticationHandler extends AbstractAuthenticationHandler {
 
+    private final Charset charset;
+
+    /**
+     * @since 5.3
+     */
+    public BasicAuthenticationHandler(final Charset charset) {
+        this.charset = charset != null ? charset : StandardCharsets.UTF_8;
+    }
+
+    public BasicAuthenticationHandler() {
+        this(StandardCharsets.US_ASCII);
+    }

Review Comment:
   I see, the for consistency reasons the one-arg constructor should not allow 
null, encoding must be explicit then. Then the client can explicitly pass 
`UTF-8` and the rest will always be `US-ASCII`. We could also consider to use 
always `UTF-8` since ASCII input will always work.



-- 
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