Hello,
We have a regression report in JMeter 3.0 due to what seems to be a new
behaviour of HttpClient 4.5.2, introduced  on Feb 25, 2014 by:

   -
   
https://github.com/apache/httpclient/commit/5d11a3e751fe0c02a7a4539d3436b06e0be35876#diff-c54e3439558bee75dd7e2953280a7e08


As per following code:

- 
https://github.com/apache/httpclient/blob/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java#L142


When uncompressing HttpClient removes 3 headers:
- Content-Length
- Content-Encoding
- Content-MD5

So in JMeter 3.0, we lose these 3 headers compared to 2.13:
- https://bz.apache.org/bugzilla/show_bug.cgi?id=59401

Is there a reason for removing them ?

What are our options to fix it ?
1/ Register a ResponseInterceptor before it that extracts headers ?

2/ Override process method and do this:

    private static final HttpResponseInterceptor RESPONSE_CONTENT_ENCODING
= new ResponseContentEncoding() {
        @Override
        public void process(
                final HttpResponse response,
                final HttpContext context) throws HttpException,
IOException {
            List<Header> headersToRestore = new ArrayList<>(3);

headersToRestore.addAll(Arrays.asList(response.getHeaders("Content-Length")));

headersToRestore.addAll(Arrays.asList(response.getHeaders("Content-Encoding")));

headersToRestore.addAll(Arrays.asList(response.getHeaders("Content-MD5")));
            super.process(response, context);
            for (Header headerToRestore : headersToRestore) {
                response.addHeader(headerToRestore);
            }
        }
    };

3/ Submit a patch to make this removal optional  ? But this would delay a
lot our Release which was in RC3.

Thanks in advance for your help
Regards
Philippe M.


-- 
Cordialement.
Philippe Mouawad.

Reply via email to