Skip to content

Commit

Permalink
handle case sensitivity consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 26, 2013
1 parent 95938f2 commit 49a4ffc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,5 +1,6 @@

4.51 2013-10-25
4.51 2013-10-26
- Fixed case sensitivity bug in multipart form handling.

4.50 2013-10-22
- Deprecated Mojo::UserAgent::app in favor of
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Message.pm
Expand Up @@ -277,9 +277,9 @@ sub _parse_formdata {
}

next unless my $disposition = $part->headers->content_disposition;
my ($filename) = $disposition =~ /[; ]filename\s*=\s*"?([^"]*)"?/;
my ($filename) = $disposition =~ /[; ]filename\s*=\s*"?([^"]*)"?/i;
next if ($upload && !defined $filename) || (!$upload && defined $filename);
my ($name) = $disposition =~ /[; ]name\s*=\s*"?([^";]+)"?/;
my ($name) = $disposition =~ /[; ]name\s*=\s*"?([^";]+)"?/i;
if ($charset) {
$name = decode($charset, $name) // $name if $name;
$filename = decode($charset, $filename) // $filename if $filename;
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/request_cgi.t
Expand Up @@ -443,7 +443,7 @@ is $req->content->progress, 0, 'right progress';
$req->parse("--8jXGX\x0d\x0a");
is $req->content->progress, 9, 'right progress';
$req->parse(
"Content-Disposition: form-data; name = file; filename = file.txt\x0d\x0a"
"Content-Disposition: Form-Data; Name = file; Filename = file.txt\x0d\x0a"
. "Content-Type: application/octet-stream\x0d\x0a\x0d\x0a");
is $req->content->progress, 117, 'right progress';
$req->parse('11023456789');
Expand Down

0 comments on commit 49a4ffc

Please sign in to comment.