- Added support for chunked requests if no $length value is passed to new().
- Fixed urlencoded parser to handle spaces after semicolons and equal signs
in the value. (Tom Heady, http://rt.cpan.org/Ticket/Display.html?id=31055)
+ - Fixed multipart test to properly clean up temporary files.
0.9 2007-03-27 14:00:00
- Fixed bug where empty fields in multipart/form-data were ignored.
It is currently used by L<Catalyst> to parse POST bodies.
+=head1 NOTES
+
+When parsing multipart bodies, temporary files are created to store any
+uploaded files. You must delete these temporary files yourself after
+processing them.
+
=head1 METHODS
=over 4
$body->add($buffer);
}
+ # Save tempnames for later deletion
+ my @temps;
+
for my $field ( keys %{ $body->upload } ) {
my $value = $body->upload->{$field};
for ( ( ref($value) eq 'ARRAY' ) ? @{$value} : $value ) {
- delete $_->{tempname};
+ push @temps, delete $_->{tempname};
}
}
is_deeply( $body->upload, $results->{upload}, "$test MultiPart upload" );
cmp_ok( $body->state, 'eq', 'done', "$test MultiPart state" );
cmp_ok( $body->length, '==', $body->content_length, "$test MultiPart length" );
+
+ # Clean up temp files created
+ unlink map { $_ } grep { -e $_ } @temps;
}