fix
This commit is contained in:
parent
beeb013b28
commit
8aedfdf82f
|
|
@ -353,15 +353,17 @@ export const _ = {
|
||||||
if (req.headers.get("accept-encoding")?.includes("gzip")) {
|
if (req.headers.get("accept-encoding")?.includes("gzip")) {
|
||||||
const file = Bun.file(src_path);
|
const file = Bun.file(src_path);
|
||||||
|
|
||||||
return new Response(
|
if (await file.exists()) {
|
||||||
await gzipAsync(new Uint8Array(await file.arrayBuffer())),
|
return new Response(
|
||||||
{
|
await gzipAsync(new Uint8Array(await file.arrayBuffer())),
|
||||||
headers: {
|
{
|
||||||
"content-encoding": "gzip",
|
headers: {
|
||||||
"content-type": mime.getType(src_path) || "",
|
"content-encoding": "gzip",
|
||||||
},
|
"content-type": mime.getType(src_path) || "",
|
||||||
}
|
},
|
||||||
);
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return index_html;
|
return index_html;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue