On 13/10/2007, cwang <[EMAIL PROTECTED]> wrote:
What response header do you get?
What actual response header do you get from the application?
when I said "original headers" i mean the headers past into
massageResponseHeaders(SampleResult res, String headers),so pretty much
by
passed that method.
I think that's because the JMeter Proxy uses a sampler to get the
response, and the sampler will already have unzipped the data.
That makes sense but then why would removing the "Content-Encoding: gzip"
header cause IE7 to not display the page?
If it just removes "gzip" from the header, that might leave something
invalid, which is why I asked what the actual header was.
I understand adding "Accept-Encoding: gzip, deflate" will probably cause
havoc on trying to proxy pages without that, but on the application we
are
testing every page has that so it should be ok. Do you have any idea
what
other problems these changes will cause? I would like to look into them
before we start full scale testing.
No idea, but I presume the code is there for a reason.
sebb-2 wrote:
On 12/10/2007, cwang <[EMAIL PROTECTED]> wrote:
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.
I think that's because the JMeter Proxy uses a sampler to get the
response, and the sampler will already have unzipped the data.
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.
What response header do you get?
I was wondering if these changes would cause error or corrupt data in
other
areas of JMeter.
Probably.
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/a-few-problems-I-encountered-gzip-and-header-tf4614182.html#a13185274
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]