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

SoapSampler uses wrong response header field to decide if response is gzip encoded #2330

Closed
asfimport opened this issue Jan 14, 2010 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Thomas Einwaller (Bug 48542):
currently the SoapSampler uses the response header field Transfer-Encoding to decide if response is gzip encoded and has to be sent through the GZIPInputStream

It should use the response header field Content-Encoding which is set to gzip by apache for example if the response body is gzip encoded by mod_deflate

Severity: major
OS: Windows XP

@asfimport
Copy link
Collaborator Author

Thomas Einwaller (migrated from Bugzilla):
Created attachment SoapSampler.java.patch: Patch that changes checked response header field to Content-Encoding

SoapSampler.java.patch
Index: src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
===================================================================
--- src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java	(revision 895607)
+++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java	(working copy)
@@ -58,6 +58,8 @@
 
 	private static final String SOAPACTION = "SOAPAction"; //$NON-NLS-1$
 
+	private static final String RESPONSE_CONTENT_ENCODING = "Content-Encoding"; //$NON-NLS-1$
+
 	public void setXmlData(String data) {
 		setProperty(XML_DATA, data);
 	}
@@ -241,7 +243,7 @@
 
             if (instream != null) {// will be null for HEAD
 
-                org.apache.commons.httpclient.Header responseHeader = httpMethod.getResponseHeader(TRANSFER_ENCODING);
+                org.apache.commons.httpclient.Header responseHeader = httpMethod.getResponseHeader(RESPONSE_CONTENT_ENCODING);
                 if (responseHeader != null && ENCODING_GZIP.equals(responseHeader.getValue())) {
                     instream = new GZIPInputStream(instream);
                 }

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Oops! Thanks for the report, fixed in:

URL: http://svn.apache.org/viewvc?rev=899207&view=rev
Log:
#2330 - SoapSampler uses wrong response header field to decide if response is gzip encoded

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