Add mimetype for .js.map

This commit is contained in:
2023-06-22 08:02:47 +08:00
parent d46b421640
commit ceab69b255

View File

@@ -62,6 +62,9 @@ export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
const opts: GetFileResponseOptions = {};
opts.range = req.headers.get("Range");
opts.if_modified_since = req.headers.get("If-Modified-Since");
if (file.endsWith(".js.map")) {
opts.mimetype = "application/json";
}
return get_file_response(file, opts);
}
const res = await ctx.next();