From 669671bd463e2dcbe4602c11af84f8e79e4fe436 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 28 May 2025 09:52:48 -0400 Subject: [PATCH] fix(internal): register mime type for .mjs files (#577) Closes #575 I'm gonna be totally honest, I'm not sure if this is needed. However, measure twice, cut once. Signed-off-by: Xe Iaso --- docs/docs/CHANGELOG.md | 1 + internal/mimetype.go | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 internal/mimetype.go diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index 78abe7b..b33d876 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rename cookies in response to user feedback - Ensure cookie renaming is consistent across configuration options - Add Bookstack app in data +- Ensure client JavaScript is served with Content-Type text/javascript. - Add `--target-host` flag/envvar to allow changing the value of the Host header in requests forwarded to the target service. - Bump AI-robots.txt to version 1.31 - Add `RuntimeDirectory` to systemd unit settings so native packages can listen over unix sockets diff --git a/internal/mimetype.go b/internal/mimetype.go new file mode 100644 index 0000000..a0a1566 --- /dev/null +++ b/internal/mimetype.go @@ -0,0 +1,7 @@ +package internal + +import "mime" + +func init() { + mime.AddExtensionType(".mjs", "text/javascript") +}