Add a few more mimetypes.

This commit is contained in:
Jos van den Oever
2013-02-20 08:04:55 +01:00
parent f86b9a80a0
commit 80a9567ee1
+6
View File
@@ -135,10 +135,16 @@ http.createServer(function (request, response) {
head["Content-Type"] = "application/vnd.oasis.opendocument.spreadsheet";
} else if (filename.substr(-4) === ".txt") {
head["Content-Type"] = "text/plain; charset=utf-8";
} else if (filename.substr(-5) === ".html") {
head["Content-Type"] = "text/html; charset=utf-8";
} else if (filename.substr(-6) === ".xhtml") {
head["Content-Type"] = "application/xhtml+xml; charset=utf-8";
} else if (filename.substr(-4) === ".xml") {
head["Content-Type"] = "text/xml; charset=utf-8";
} else if (filename.substr(-4) === ".ttf") {
head["Content-Type"] = "application/x-font-ttf";
} else if (filename.substr(-4) === ".png") {
head["Content-Type"] = "image/png";
}
response.writeHead(200, head);
if (request.method !== "HEAD") {