Subject: | Workaround for incorrect chunked responses |
Hello
Some servers, for example Yahoo send chunk lenght contrary to RFC.
This is the lenght part of chunked packet from yahoo:
"753e \r\n"
It has spaces between number in hex and CRLF. This is not by RFC, but
better to add workaround for such case (currently length is not matched by Filter/HTTPChunk.pm and whole body is ignored).
I'm proposing to change one line in Filter/HTTPChunk.pm
from:
94 if ($chunk =~ s/^($HEX+)(?:;.*)?\015?\012//s) {
to:
94 if ($chunk =~ s/^($HEX+)(?:;.*?)\s*?\015?\012//s) {
There are two changes.
1. Match possible spaces before CRLF
2. Use non greedy matching for chunk-extensions (because if extensions are used and body contains CRLF part of body can truncated)
Please apply this fix. Spaces does not conform RFC, however better to have such workaround.
Thank you in advance.