Skip Menu |

This queue is for tickets about the POE-Filter-HTTP-Parser CPAN distribution.

Report information
The Basics
Id: 59772
Status: resolved
Worked: 15 min
Priority: 0/
Queue: POE-Filter-HTTP-Parser

People
Owner: BINGOS [...] cpan.org
Requestors: ASCENT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.02
Fixed in: (no value)



Subject: Double encoded utf-8 strings
Hi, HTTP::Message content is always byte-encoded. Functions _put_response() and _put_request() concatenate string with UTF-8 flag and without, which makes double encoded utf-8 strings. Sample patch attached. -- ascent
Subject: poe-filter-http-parser-patch.txt
--- old-Parser.pm 2010-07-28 13:34:38.000000000 +0200 +++ Parser.pm 2010-07-28 13:15:58.000000000 +0200 @@ -6,6 +6,7 @@ use HTTP::Status qw(status_message RC_BAD_REQUEST RC_OK RC_LENGTH_REQUIRED); use base 'POE::Filter'; use vars qw($VERSION); +use Encode; $VERSION = '1.02'; @@ -110,7 +111,7 @@ push @headers, $status_line; push @headers, $_->headers_as_string("\x0D\x0A"); - push @raw, join("\x0D\x0A", @headers, "") . $_->content; + push @raw, encode_utf8(join("\x0D\x0A", @headers, "")) . $_->content; } \@raw; @@ -135,7 +136,7 @@ push @headers, $req_line; push @headers, $_->headers_as_string("\x0D\x0A"); - push @raw, join("\x0D\x0A", @headers, "") . $_->content; + push @raw, encode_utf8(join("\x0D\x0A", @headers, "")) . $_->content; } \@raw;
According to my records this was applied to the last release made to CPAN, namely version 1.04. Many thanks.