mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
This commit is contained in:
@@ -132,6 +132,11 @@ fn getContentType(file_path: []const u8) []const u8 {
|
|||||||
return "text/xml";
|
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});
|
std.debug.print("TestHTTPServer asked to serve an unknown file type: {s}\n", .{file_path});
|
||||||
return "text/html";
|
return "text/html";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -581,6 +581,11 @@ const TestHTTPServer = struct {
|
|||||||
return "text/xml";
|
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});
|
std.debug.print("TestHTTPServer asked to serve an unknown file type: {s}\n", .{file_path});
|
||||||
return "text/html";
|
return "text/html";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user