From 84ca690684a0a69b2fd7bc83822ac22c052a3296 Mon Sep 17 00:00:00 2001 From: catvayor Date: Sun, 11 Jun 2023 17:30:57 +0200 Subject: [PATCH] solved MIME type warnings --- traque.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/traque.js b/traque.js index 4f549a0..3252146 100644 --- a/traque.js +++ b/traque.js @@ -90,7 +90,10 @@ var server = http.createServer(option, function(req, res){ res.writeHead(404, {'Content-Type': 'text/html'}); return res.end("404 Not Found"); } - res.writeHead(200, {'Content-Type': 'text/html'}); + if(filename.endsWith('.js')) + res.writeHead(200, {'Content-Type': 'text/javascript'}); + else + res.writeHead(200, {'Content-Type': 'text/html'}); res.write(data); return res.end(); });