Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMeter support for gzip for requests when content-encoding is set to gzip #3693

Open
asfimport opened this issue Nov 13, 2015 · 0 comments
Open

Comments

@asfimport
Copy link
Collaborator

jayakhanna.p (Bug 58609):
While setting the content-encoding to gzip in the http header manager and trying to send the POST request, the http body content isn't compressed and eventually throws an error.

Would be good to add support for gzip, deflate for the request too. Looked at the code and we do use GzipInputStream for the responses.

http://svn.apache.org/repos/asf/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
<snip>
if (instream != null) {// will be null for HEAD
instream = new CountingInputStream(instream);
try {
Header responseHeader = httpMethod.getResponseHeader(HTTPConstants.HEADER_CONTENT_ENCODING);
if (responseHeader!= null && HTTPConstants.ENCODING_GZIP.equals(responseHeader.getValue())) {
InputStream tmpInput = new GZIPInputStream(instream); // tmp inputstream needs to have a good counting
res.setResponseData(readResponse(res, tmpInput, (int) httpMethod.getResponseContentLength()));
} else {
res.setResponseData(readResponse(res, instream, (int) httpMethod.getResponseContentLength()));
}
} finally {
JOrphanUtils.closeQuietly(instream);
}
}
<snip>

OS: All

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant