Subject: | HTTP::Request::Common.pm bugs/problems |
Perl v. 5.8.0
libwww-perl 5.79
module HTTP::Request::Common.pm, line 203:
1)
unless ( -f $f && ($file_size = -s _) ) {
'-s _' in this context always returns 0, as a result there is no Content-Length header for dynamic content. May be a problem for some servers. Can be changed to '-s $f' I think.
2) I'm not sure that the second one can be considered as a bug, but it definitely causes a problem when I work with Domino 4.6.7 web server. The problem is related to mime headers in multipart forms that are prepared by form_data function. It looks like the web server above expects exactly two headers and interprets everything else as data. As a result extra headers become a part of content and get uploaded to the server. It causes a real problem when you upload binary data. To fix this for my particular task I had to comment out the following lines (158,159) in Common.pm:
#OG require LWP::MediaTypes;
#OG $ct = LWP::MediaTypes::guess_media_type($file, $h);
and get rid of extra empty line (171):
my $head = join($CRLF, "Content-Disposition: $disp",
$h->as_string($CRLF));
#OG $h->as_string($CRLF),
#OG "");
After that everything started to work correctly.
It would be great to have a flag that would allow to disable mime extensions. The second suggestion would be to remove the empty line that follows headers (but I'm not sure if the latter one will be compliant with RFC RFC1867)