From: Simon Elliott Date: Fri, 8 Oct 2010 14:51:49 +0000 (+0000) Subject: patch for 1.10 X-Git-Tag: v1.10^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Ftags%2Fv1.10;p=catagits%2FHTTP-Body.git patch for 1.10 --- diff --git a/Changes b/Changes index 41ec75b..2c0ac4a 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,12 @@ This file documents the revision history for Perl extension HTTP::Body. -1.08 +1.10 Fri 8 Oct 2010 15:50:55 UTC + - Patch for test failure ( thanks KENTNL/MITHALDU! ) + +1.09 Thu 19 Aug 2010 19:08:55 UTC + - remove blib for PAUSE indexing. + +1.08 Thu 19 Aug 2010 18:08:42 UTC - Temp files now preserve the suffix of the uploaded file. This makes it possible to feed the file directly into a mime-type-determining module that may rely on this suffix as part of its heuristic. (Dave diff --git a/dist.ini b/dist.ini index 24e14e6..3ef0abd 100644 --- a/dist.ini +++ b/dist.ini @@ -1,5 +1,5 @@ name = HTTP-Body -version = 1.08 +version = 1.10 author = Christian Hansen, C author = Sebastian Riedel, C author = Andy Grundman, C @@ -18,4 +18,10 @@ IO::File = 1.14 [Prereqs / TestRequires] Test::More = 0.86 -Test::Deep = 0 \ No newline at end of file +Test::Deep = 0 + +[MetaResources] +repository.web = http://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/ +repository.url = https://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/ +repository.type = svn +x_mailing_list = http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev diff --git a/lib/HTTP/Body.pm b/lib/HTTP/Body.pm index eb096b1..9b41753 100644 --- a/lib/HTTP/Body.pm +++ b/lib/HTTP/Body.pm @@ -390,6 +390,20 @@ sub tmpdir { =back +=head1 SUPPORT + +Since its original creation this module has been taken over by the Catalyst +development team. If you want to contribute patches, these will be your +primary contact points: + +IRC: + + Join #catalyst-dev on irc.perl.org. + +Mailing Lists: + + http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev + =head1 AUTHOR Christian Hansen, C @@ -398,6 +412,14 @@ Sebastian Riedel, C Andy Grundman, C +=head1 CONTRIBUTORS + +Simon Elliott C + +Kent Fredric + +Christian Walde + =head1 LICENSE This library is free software. You can redistribute it and/or modify diff --git a/lib/HTTP/Body/MultiPart.pm b/lib/HTTP/Body/MultiPart.pm index 5b0adff..0296171 100644 --- a/lib/HTTP/Body/MultiPart.pm +++ b/lib/HTTP/Body/MultiPart.pm @@ -6,6 +6,7 @@ use bytes; use IO::File; use File::Temp 0.14; +use File::Spec; =head1 NAME @@ -270,7 +271,8 @@ sub handler { $part->{filename} = $filename; if ( $filename ne "" ) { - my $suffix = $filename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{}; + my $basename = (File::Spec->splitpath($filename))[2]; + my $suffix = $basename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{}; my $fh = File::Temp->new( UNLINK => 0, DIR => $self->tmpdir, SUFFIX => $suffix ); diff --git a/t/08multipart-suffix.t b/t/08multipart-suffix.t index 367db05..20ae483 100644 --- a/t/08multipart-suffix.t +++ b/t/08multipart-suffix.t @@ -54,8 +54,8 @@ my $path = catdir( getcwd(), 't', 'data', 'multipart' ); 'tempname preserves .txt suffix when dir name has .' ); - unlike( - $uploads->{upload2}{tempname}, qr/\\/, + like( + $uploads->{upload2}{tempname}, qr/[\\\/]\w+.txt$/, 'tempname only gets extension from filename, not from a directory name' ); }