solved MIME type warnings

This commit is contained in:
catvayor 2023-06-11 17:30:57 +02:00
parent 93be3718c5
commit 84ca690684

View file

@ -90,7 +90,10 @@ var server = http.createServer(option, function(req, res){
res.writeHead(404, {'Content-Type': 'text/html'}); res.writeHead(404, {'Content-Type': 'text/html'});
return res.end("404 Not Found"); 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); res.write(data);
return res.end(); return res.end();
}); });