From 707420a557ae82f188ae23b1820264b467647ff3 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:11:08 -0500 Subject: [PATCH] Set correct JS mime type --- serve.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serve.js b/serve.js index 81aec59..5dcb886 100644 --- a/serve.js +++ b/serve.js @@ -26,8 +26,11 @@ http.createServer(function (request, response) { options.end = parseInt(matches[2])+1; response.setHeader('Content-Length', options.end - options.start); } + // set MIME types if (fsPath.endsWith(".svg")) { response.setHeader('Content-Type', "image/svg+xml"); + } else if (fsPath.endsWith(".js")) { + response.setHeader('Content-Type', "text/javascript"); } let fileStream = fs.createReadStream(fsPath, options)