Permalink
Browse files

Support upper case in file extensions.

  • Loading branch information...
1 parent 5ea7c13 commit a36d2cb4d1fcc6bfd6ae9e33beb2799b5441de5d @vilcans vilcans committed Jun 11, 2013
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/incoming_form.js
  2. +3 −0 test/unit/test-incoming-form.js
@@ -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;
}
@@ -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');
},
});

0 comments on commit a36d2cb

Please sign in to comment.