BUG: linefeeds in HTTP::Response->parse [rt.cpan.org #54266]
oalders opened this issue · comments
Olaf Alders commented
Migrated from rt.cpan.org#54266 (status was 'new')
Requestors:
Attachments:
From http://andy.jenkinson.myopenid.com/ on 2010-02-03 16:45:57
:
Hi there,
I've just discovered a problem in the handling of newlines in the HTTP::Response "parse"
method. Basically, the HTTP specification defines the use of CRLF to indicate a newline
whereas this method expects only LF. The bug does not appear to affect the equivalent
method in HTTP::Message, which processes CRLF correctly.
The issue manifests as $response->status_line having a CR on the end. It affects situations
where the method is used to parse "real" HTTP spec compliant web server responses (which
typically use CRLF). It does not occur when parsing the default output from the
HTTP::Response->as_string method, which uses LF instead of CRLF.
I've attached a patch and test.
Cheers,
Andy
Neil Bowers commented
This has been applied, as can be seen by looking at the patch in RT, and then this line in HTTP::Response.
So can be closed.
Olaf Alders commented
Thanks for the research, @neilb!