Skip to content

Commit

Permalink
Fix #167
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Sep 25, 2017
1 parent 1f0af63 commit 855d0c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ assert.equal('application/font-woff', mime.lookup('file.woff'));
assert.equal('application/octet-stream', mime.lookup('file.buffer'));
// TODO: Uncomment once #157 is resolved
// assert.equal('audio/mp4', mime.lookup('file.m4a'));
assert.equal('font/opentype', mime.lookup('file.otf'));
assert.equal('font/otf', mime.lookup('file.otf'));

//
// Test charsets
Expand Down
2 changes: 1 addition & 1 deletion mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Mime.prototype.load = function(file) {
* Lookup a mime type based on extension
*/
Mime.prototype.lookup = function(path, fallback) {
var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();
var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase();

return this.types[ext] || fallback || this.default_type;
};
Expand Down

0 comments on commit 855d0c4

Please sign in to comment.