Subject: | Net::HTTP::Methods does not recognize compressed responses (on some servers) |
Net:HTTP if Compress::Zlib available add
TE: deflate,gzip q=0.3
Connection: TE, close
but can't handle compressed responses in some cases:
it exptects headers like:
Transfer-Encoding: gzip
Transfer-Encoding: chunked
but some server send Content-Encoding header instead of first:
Content-Encoding: gzip
Transfer-Encoding: chunked
I've attatched patch for this simple problem.
Please fix, this is important for me.
--- Methods.pm.orig 2003-12-24 01:26:53.000000000 +0200
+++ Methods.pm 2004-04-22 15:54:50.000000000 +0300
@@ -330,7 +330,7 @@
my $content_length;
for (my $i = 0; $i < @headers; $i += 2) {
my $h = lc($headers[$i]);
- if ($h eq 'transfer-encoding') {
+ if ($h eq 'transfer-encoding' || $h eq 'content-encoding') {
push(@te, $headers[$i+1]);
}
elsif ($h eq 'content-length') {