fix
This commit is contained in:
parent
b1088b537c
commit
2474b88931
|
|
@ -90,22 +90,16 @@ export const _ = {
|
||||||
const codepath = arr.join("/");
|
const codepath = arr.join("/");
|
||||||
const build_path = code.path(site_id, "site", "build", codepath);
|
const build_path = code.path(site_id, "site", "build", codepath);
|
||||||
|
|
||||||
try {
|
let file = Bun.file(build_path);
|
||||||
let file = Bun.file(build_path);
|
return new Response(
|
||||||
return new Response(
|
await gzipAsync(new Uint8Array(await file.arrayBuffer())),
|
||||||
await gzipAsync(new Uint8Array(await file.arrayBuffer())),
|
{
|
||||||
{
|
headers: {
|
||||||
headers: {
|
"content-encoding": "gzip",
|
||||||
"content-encoding": "gzip",
|
"content-type": mime.getType(build_path) || "",
|
||||||
"content-type": mime.getType(build_path) || "",
|
},
|
||||||
},
|
}
|
||||||
}
|
);
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
return new Response("location.reload", {
|
|
||||||
headers: { "content-type": "application/javascript" },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case "route": {
|
case "route": {
|
||||||
if (!g.route_cache) g.route_cache = {};
|
if (!g.route_cache) g.route_cache = {};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue