Skip to content

Commit

Permalink
Support upper case in file extensions.
Browse files Browse the repository at this point in the history
Fixes #233
  • Loading branch information
vilcans committed Jun 11, 2013
1 parent 5ea7c13 commit a36d2cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/incoming_form.js
Expand Up @@ -518,7 +518,7 @@ IncomingForm.prototype._uploadPath = function(filename) {

if (this.keepExtensions) {
var ext = path.extname(filename);
ext = ext.replace(/(\.[a-z0-9]+).*/, '$1');
ext = ext.replace(/(\.[a-z0-9]+).*/i, '$1');

name += ext;
}
Expand Down
3 changes: 3 additions & 0 deletions test/unit/test-incoming-form.js
Expand Up @@ -55,6 +55,9 @@ test('IncomingForm', {

ext = path.extname(form._uploadPath('super.bar'));
assert.equal(ext, '.bar');

ext = path.extname(form._uploadPath('file.aAa'));
assert.equal(ext, '.aAa');
},
});

Expand Down

0 comments on commit a36d2cb

Please sign in to comment.