diff --git a/HISTORY.md b/HISTORY.md index 593919e..bbdb0c7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,7 @@ unreleased ========== + * Fix icons for MIME types with `+` * Fix text and json responses to match html sorting * Show font icon for more font types * Use 400 error on URI decode failure instead of 500 diff --git a/index.js b/index.js index 09086ac..e95390e 100644 --- a/index.js +++ b/index.js @@ -416,7 +416,7 @@ function iconLookup(filename) { // try by mime type if (icons[mimetype]) { return { - className: 'icon-' + mimetype.replace('/', '-'), + className: 'icon-' + mimetype.replace('/', '-').replace('+', '_'), fileName: icons[mimetype] }; } diff --git a/test/fixtures/collect/sample.svg b/test/fixtures/collect/sample.svg new file mode 100644 index 0000000..e69de29 diff --git a/test/test.js b/test/test.js index e5a5270..c1509a4 100644 --- a/test/test.js +++ b/test/test.js @@ -386,6 +386,7 @@ describe('serveIndex(root)', function () { .expect(/icon-default/) .expect(/icon-directory/) .expect(/icon-image/) + .expect(/icon-image-svg_xml/) .expect(/icon-txt/) .expect(/icon-application-pdf/) .expect(/icon-video/)