Karl Seguin
2025-12-18 21:17:13 +08:00
parent ba4900b61f
commit c3f8f9de54
2 changed files with 10 additions and 0 deletions

View File

@@ -132,6 +132,11 @@ fn getContentType(file_path: []const u8) []const u8 {
return "text/xml";
}
if (std.mem.endsWith(u8, file_path, ".mjs")) {
// mjs are ECMAScript modules
return "application/json";
}
std.debug.print("TestHTTPServer asked to serve an unknown file type: {s}\n", .{file_path});
return "text/html";
}