code review: safer test

This commit is contained in:
gorhill 2014-09-20 10:47:30 -04:00
parent 102dc8b596
commit 8262b9ec70
1 changed files with 3 additions and 3 deletions

View File

@ -231,11 +231,11 @@
if ( pos === -1 ) {
return type;
}
var ext = path.slice(pos);
if ( '.eot.ttf.otf.svg.woff'.indexOf(ext) !== -1 ) {
var ext = path.slice(pos) + '.';
if ( '.eot.ttf.otf.svg.woff.'.indexOf(ext) !== -1 ) {
return 'stylesheet';
}
if ( '.ico.png.gif.jpg.jpeg'.indexOf(ext) !== -1 ) {
if ( '.ico.png.gif.jpg.jpeg.'.indexOf(ext) !== -1 ) {
return 'image';
}
return type;