Skip Menu |
 

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 13972
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

People
Owner: martijn [...] cpan.org
Requestors: tech [...] askold.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Transfer-encoding header smashing
Download (untitled) / with headers
text/plain 995b
in file POE/Component/Client/HTTP.pm there are lines: -----------------[cut]---------------------------------- 460 my $te = $input->header('Transfer-Encoding'); 461 if (defined $te) { 462 $filter = POE::Filter::Stackable->new; 463 my @te = split(/\s*,\s*/, lc($te)); 464 while (my $encoding = pop @te) { 465 my $fclass = $te_filters{$encoding}; 466 last unless (defined $fclass); 467 $filter->push ($fclass->new); 468 } 469 $input->header('Transfer-Encoding', join(', ', @te)); 470 } ---------------------[cut]-------------------------------- In loop all elements are popped from @te until it became empty. After it at line 469 constructed header Transfer-Encoding from empty list (@te always empty because, condition of exiting from loop preceding it is empty @te). Solution is simple: just replace line 464 with: 464 foreach my $encoding (@te) {
Subject: Re: [cpan #13972] Transfer-encoding header smashing
From: Martijn van Beers <martijn [...] eekeek.org>
To: bug-POE-Component-Client-HTTP [...] rt.cpan.org
Date: Tue, 02 Aug 2005 16:02:13 +0200
RT-Send-Cc:
Download (untitled) / with headers
text/plain 560b
Show quoted text
> In loop all elements are popped from @te until it became empty. > After it at line 469 constructed header Transfer-Encoding from > empty list (@te always empty because, condition of exiting from > loop preceding it is empty @te). > > Solution is simple: just replace line 464 with: > > 464 foreach my $encoding (@te) { >
Not quite. There might be transfer encodings we don't know about, in which case we need to keep those in, while we throw out the TEs we are processing (hence the pop() call). It just needs an if (@te > 0); in line 469.
I recently revised the Transfer-Encoding header parsing. It should work now.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.