boundary=000 when using HTTP::Request::Common/form-data
Catherine Letondal (letondal@pasteur.fr)
Wed, 20 Oct 1999 14:47:02 +0200
Hi,
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).
sub boundary
{
my $size = shift || return "000";
require MIME::Base64;
my $b = MIME::Base64::encode(join("", map chr(rand(256)), 1..$size*3), "")
;
$b =~ s/[\W]/X/g; # ensure alnum only
$b;
}
Is there a way to set this boundary to another value?
Many thanks,
--
Catherine Letondal