Re: boundary=000 when using HTTP::Request::Common/form-data

Catherine Letondal (letondal@pasteur.fr)
Thu, 28 Oct 1999 14:38:18 +0200


Gisle Aas writes:
> Catherine Letondal <letondal@pasteur.fr> writes:
> 
> > I'm using libwww-perl/5.45 to POST multipart data to a CGI.
> > I use the HTTP::Request::Common facility this way:
> > 
> >     use HTTP::Request::Common;
> >     use LWP::UserAgent;
> >     my $ua = new LWP::UserAgent;
> >     my $version = $self->{VERSION};
> >     $ua->agent("Pise/$version " . $ua->agent);
> >     my $res = $ua->request(POST $cgi,
> > 			   Content_Type => 'form-data', 
> > 			   Content      => \%content);
> > 
> > This work perfectly, except when one of the parameters contains "000" somewhere
> > which happens all the time, for we have diagonal distances matrices:
> >  7
> > Bovine      0.0000  1.2530  1.3203  1.1798  0.9176  1.1367  1.0476
> > Mouse       1.2530  0.0000  1.0305  0.9441  1.0424  1.0930  0.9635
> > Gibbon      1.3203  1.0305  0.0000  0.5809  0.5984  0.5581  0.5139
> > Orang       1.1798  0.9441  0.5809  0.0000  0.3756  0.3641  0.2947
> > Gorilla     0.9176  1.0424  0.5984  0.3756  0.0000  0.3364  0.3132
> > Chimp       1.1367  1.0930  0.5581  0.3641  0.3364  0.0000  0.2149
> > Human       1.0476  0.9635  0.5139  0.2947  0.3132  0.2149  0.0000
> > 
> > I have checked that the CGI receives the correct input, this is how I have seen
> > this "000" boundary value.
> > I had a look at the code, and I saw that the boundary function is called without
> > arguments, which leads to a "000" value (except when I put a file in the content).
> 
> There is actually nothing wrong with "000" as boundary in this case.
> It is OK as long as the content does not contain the string "\n--000".

I was using CGI_Lite.pm (because of file upload facilities which are still much easier 
to use). When changing to CGI.pm, the problem seemed to be fixed.
I didn't take the time to look further into CGI_Lite.pm code, though.

Many thanks,


--
Catherine Letondal -- Pasteur Institute Computing Center