diff --git a/core.js b/core.js index a3e07fee..250b59ae 100644 --- a/core.js +++ b/core.js @@ -331,7 +331,7 @@ class FileTypeParser { // - one entry indicating specific type of file. // MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it. if (zipHeader.filename === 'mimetype' && zipHeader.compressedSize === zipHeader.uncompressedSize) { - const mimeType = await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8')); + const mimeType = (await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8'))).trim(); switch (mimeType) { case 'application/epub+zip': diff --git a/fixture/fixture-crlf.epub b/fixture/fixture-crlf.epub new file mode 100644 index 00000000..9640f7fb Binary files /dev/null and b/fixture/fixture-crlf.epub differ diff --git a/test.js b/test.js index 235f8e46..05919946 100644 --- a/test.js +++ b/test.js @@ -46,6 +46,10 @@ const names = { dng: [ 'fixture-Leica-M10', ], + epub: [ + 'fixture', + 'fixture-crlf', + ], nef: [ 'fixture', 'fixture2',