Skip to content

feat: add support for .mjs file extensions to the static file handler - #48

Merged
LinceMathew merged 2 commits into
mainfrom
fix/mime-type
May 3, 2026
Merged

LinceMathew merged 2 commits into
mainfrom
fix/mime-type

Conversation

@LinceMathew

Copy link
Copy Markdown
Contributor

Problem:

Browsers reject .mjs files if the server sends them as text/plain. This happens on Linux systems where the .mjs extension isn't in the global /etc/mime.types database, causing the UI to fail with a "Strict MIME type checking" error.

Solution:

Explicitly register .mjs as application/javascript within the application logic.

Changes:

  • Added mime.AddExtensionType(".mjs", ...) to GetStaticHandler.
  • Updated ServeStaticFile switch statement to include .mjs.

LiveReview Pre-Commit Check: ran (iter:1, coverage:0%)
@LinceMathew LinceMathew linked an issue May 3, 2026 that may be closed by this pull request
@LinceMathew
LinceMathew merged commit 3834024 into main May 3, 2026
7 checks passed
@LinceMathew
LinceMathew deleted the fix/mime-type branch May 22, 2026 16:58
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.

Black Screen in Browser After Running git lrc ui

1 participant