This file documents the revision history for Perl extension HTTP::Body.
+0.7 2007-03-23 10:00:00
+ - Fixed parsing an empty (zero-length) file using multipart.
+ http://rt.cpan.org/NoAuth/Bug.html?id=25392
+
0.6 2006-01-06 00:00:00
- Fixed buffer bug in OctetStream, reported by Daisuke Murase <typester@cpan.org>.
- Fixed YAML prereq, reported by Jess Robinson
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: HTTP-Body
-version: 0.4
+version: 0.7
version_from: lib/HTTP/Body.pm
installdirs: site
requires:
Carp: 0
File::Temp: 0.14
IO::File: 0
- YAML: 0
+ YAML: 0.39
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
use Carp qw[ ];
-our $VERSION = 0.6;
+our $VERSION = 0.7;
our $TYPES = {
'application/octet-stream' => 'HTTP::Body::OctetStream',
sub handler {
my ( $self, $part ) = @_;
+ my $disposition = $part->{headers}->{'Content-Disposition'};
+ my ($name) = $disposition =~ / name="?([^\";]+)"?/;
+ my ($filename) = $disposition =~ / filename="?([^\"]+)"?/;
+
# skip parts without content
- if ( $part->{done} && $part->{size} == 0 ) {
+ if ( $part->{done} && $part->{size} == 0 && !$filename) {
return 0;
}
unless ( exists $part->{name} ) {
- my $disposition = $part->{headers}->{'Content-Disposition'};
- my ($name) = $disposition =~ / name="?([^\";]+)"?/;
- my ($filename) = $disposition =~ / filename="?([^\"]+)"?/;
$part->{name} = $name;
$part->{filename} = $filename;
print "Hello World :)\n";
\r
+------------0xKhTmLbOuNdArY\r
+Content-Disposition: form-data; name="upload3"; filename="blank.pl"\r
+Content-Type: application/octet-stream\r
+\r
+\r
------------0xKhTmLbOuNdArY--\r
---
-Content-Length: 1559
+Content-Length: 1701
Content-Type: multipart/form-data; boundary=----------0xKhTmLbOuNdArY
User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
Content-Type: application/octet-stream
name: upload2
size: 71
+ upload3:
+ filename: blank.pl
+ headers:
+ Content-Disposition: form-data; name="upload3"; filename="blank.pl"
+ Content-Type: application/octet-stream
+ name: upload3
+ size: 0