Subject: | Transfer-Encoding chunked,chunked causing x-died in Net::HTTP::Methods |
When server returns returns two HTTP Transfer-Encoding headers of 'chunked',
LWP::UserAgent returns a code of 200 and an empty content. in the
response headers is an
'x-died' => 'Can\'t handle transfer encoding \'chunked,chunked\' at
/home/tbianchini/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/HTTP/Methods.pm
line 452.'
Browsers handle this so I think LWP::UserAgent should be able to too.
Here is a patch
->diff Methods.pm.orig Methods.pm
370a371
Show quoted text
> my $chunked;
377c378,383
< push(@te, $te) if length($te);
---
Show quoted text> if ( length($te) ) {
> if ( $te eq 'chunked' ) {
> $chunked++;
> }
> push(@te, $te)
> }
384a391,393
Show quoted text> }
> if ( $chunked > 1 & scalar @te == $chunked ) {
> @te=qw(chunked);
rwxr--r-- 1 tbianchini tbianchini 14942 May 16 10:10 ./Methods.pm
Show quoted text>head ./Methods.pm
package Net::HTTP::Methods;
require 5.005; # 4-arg substr
use strict;
use vars qw($VERSION);
$VERSION = "6.00";
Net-Http v 6.0
perl -v (v5.14.2)
Linux 2.6.32-5-amd64