Skip to content

fix: add e-book MIME types - #6149

Open
PixelQuasar wants to merge 1 commit into
Unitech:developmentfrom
PixelQuasar:serve-ebook-mime
Open

fix: add e-book MIME types#6149
PixelQuasar wants to merge 1 commit into
Unitech:developmentfrom
PixelQuasar:serve-ebook-mime

Conversation

@PixelQuasar

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? not run — data-only change, verified manually (below)
Fixed tickets #6148
License MIT

Adds four e-book formats to the MIME table in lib/API/Serve.js. They are
currently absent, so pm2 serve labels them text/plain: browsers render the
bytes instead of downloading the file, and readers that dispatch on
Content-Type do not recognise it.

'azw3': 'application/vnd.amazon.mobi8-ebook',
'epub': 'application/epub+zip',
'fb2':  'application/x-fictionbook+xml',
'mobi': 'application/x-mobipocket-ebook',

Entries are inserted in the existing alphabetical order. application/epub+zip
is registered with IANA; the other three are the de facto values.

Purely additive — it only affects extensions that previously fell through to
the default, so nothing that works today changes. In particular the text/plain
fallback itself is untouched.

Verification

Ran the patched Serve.js directly, same way PM2 invokes it:

book.epub      → application/epub+zip
book.fb2       → application/x-fictionbook+xml
book.mobi      → application/x-mobipocket-ebook
book.azw3      → application/vnd.amazon.mobi8-ebook
book.pdf       → application/pdf      (unchanged, already in the table)
note.unknown   → text/plain           (unchanged, fallback intact)

The last two lines are the point: existing behaviour is unaffected.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@PixelQuasar PixelQuasar changed the title serve: add e-book MIME types fix: add e-book MIME types Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants