Fwd: [cpan #13025] parsing bug in HTTP::Message::parse()

Brian Hirt <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
FYI, i'm not the only one seeing this bug.

Begin forwarded message:

> From: " via RT" <[email protected]>
> Date: August 13, 2005 8:55:10 PM MDT
> To: [email protected]
> Subject: [cpan #13025] parsing bug in HTTP::Message::parse()
> Reply-To: [email protected]
>
>
> Full context and any attached attachments can be found at:
> <URL: http://rt.cpan.org/NoAuth/Bug.html?id=13025 >
>
> [guest - Mon May 30 19:20:21 2005]:
>
>
>> Hi!
>>
>> I've stumbled across a bug in multi-part messages in HTTP::Message.
>>    If the message content contains something that looks like a  
>> header,
>>    it accidentally gets detected as a header.   However, a blank line
>>    after a header should signal the end of headers, and below it, the
>>    start of content as per the spec.  It just looks like your regex
>>    needs some tweeking, or maybe do something like this:
>>
>
> Found the same problem today... :(
>
>   #!/usr/bin/perl
>   use strict;
>   use warnings;
>   use HTTP::Message;
>   use Data::Dumper;
>
>   my $bad = qq(Content-Disposition: form-data; name="fetch_url"\n)
>       . qq(\nhttp://www.jbisbee.com/\n);
>   my $part = HTTP::Message->parse($bad);
>   warn Dumper($part);
>
> With the output...
>
>   $VAR1 = bless( {
>     '_content' => '',
>     '_headers' => bless( {
>       'content-disposition' => 'form-data; name="fetch_url"',
>       '                                  '
> http' => '//www.jbisbee.com/'
>     }, 'HTTP::Headers' )
>   }, 'HTTP::Message' );
>
> of course this only happens with forms that specify
>
>   enctype="multipart/form-data"
>
> for uploads so it may be a bit hard to reproduce
>

--------------------------------------------
MobyGames
http://www.mobygames.com
The world's largest and most comprehensive
gaming database project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.