Subject: | decode_content issue with "Content-Encoding: none" |
Date: | Wed, 10 Dec 2014 12:23:25 +0100 |
To: | bug-HTTP-Message [...] rt.cpan.org |
From: | Matthias Reik <maze [...] reik.se> |
The decode_content seems to follow very accurately the standard, but
unfortunately web servers do not.
I have one case where the web server is responding with a
"Content-Encoding: none", and because of that
the character decoding isn't run, because of the else statement:
else {
die "Don't know how to decode Content-Encoding '$ce'";
}
I'm not sure how common this "none" case is, so it might not be
legitimate to add that as an extra supported
Content-Encoding type (which does nothing).
As a simple workaround I can copy the decode_content function, but IMHO
this is not ideal. It would be better
if the library would allow to specify the desired behavior in those cases.
An extra option could solve this:
else {
unless ($opt{ignore_unknown_content_encoding}) {
die "Don't know how to decode Content-Encoding
'$ce'";
}
}
I think this approach could also be used for other reported issues like
https://rt.cpan.org/Public/Bug/Display.html?id=82963
Cheers
Maze