You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2019/07/27 18:47:52 UTC

[GitHub] [httpcomponents-client] coxlinton commented on a change in pull request #157: Make Accept-Encoding header handling thread-safe

coxlinton commented on a change in pull request #157: Make Accept-Encoding header handling thread-safe
URL: https://github.com/apache/httpcomponents-client/pull/157#discussion_r307974156
 
 

 ##########
 File path: httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java
 ##########
 @@ -70,16 +71,20 @@
 @Internal
 public final class ContentCompressionExec implements ExecChainHandler {
 
-    private final String[] acceptEncoding;
+    private final Header acceptEncoding;
     private final Lookup<InputStreamFactory> decoderRegistry;
     private final boolean ignoreUnknown;
 
     public ContentCompressionExec(
             final List<String> acceptEncoding,
             final Lookup<InputStreamFactory> decoderRegistry,
             final boolean ignoreUnknown) {
-        this.acceptEncoding = acceptEncoding != null ? acceptEncoding.toArray(
-                new String[acceptEncoding.size()]) : new String[] {"gzip", "x-gzip", "deflate"};
+        // MessageSupport.format is not thread-safe, because it sorts the
 
 Review comment:
   Not at all - that definitely seems like an excellent idea. Updated made.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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