when my browser sent a header with "Accept-Encoding: gzip, deflate" it
doesn't seem to be picked up by jmeter. It was kind of weird cause it
wasn't even in the input stream.
then when I get the response there was a piece of code in Jmeter that
removed "Content-Encoding: gzip"
in proxy.java
/**
* In the event the content was gzipped and unpacked, the
content-encoding
* header must be removed and the content-length header should be
corrected.
*
* @param res
* @param headers
* @return
*/
private String massageResponseHeaders(SampleResult res, String headers)
{
int encodingHeaderLoc = headers.indexOf(": gzip"); //
$NON-NLS-1$
String newHeaders = headers;
if (encodingHeaderLoc > -1) {
int end = headers.indexOf(NEW_LINE, encodingHeaderLoc);
int begin = headers.lastIndexOf(NEW_LINE,
encodingHeaderLoc);
newHeaders = newHeaders.substring(0, begin) +
newHeaders.substring(end);
int lengthIndex = newHeaders.indexOf("ength: "); //
$NON-NLS-1$
end = newHeaders.indexOf(NEW_LINE, lengthIndex);
newHeaders = newHeaders.substring(0, lengthIndex + 7) +
res.getResponseData().length
+ newHeaders.substring(end);
}
return newHeaders;
}
I don't know why this piece of code was added but it cause my browser,
Internet Explorer 7, to return with a page cannot be displayed error.
by hard coding "Accept-Encoding: gzip, deflate" into all my request header
and returning the original "headers" from massageResponseHeaders it seems to
work for my case.
I was wondering if these changes would cause error or corrupt data in other
areas of JMeter.
Thanks
--
View this message in context:
http://www.nabble.com/a-few-problems-I-encountered-gzip-and-header-tf4614182.html#a13177025
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]