This commit is contained in:
Rizky
2024-03-21 11:37:02 +07:00
parent e66bd5fc1f
commit 80db2618fc
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -2,6 +2,7 @@ import { apiContext } from "service-srv";
import { SinglePage, g } from "utils/global";
import { gzipAsync } from "utils/gzip";
import { getContent } from "../server/prep-api-ts";
import mime from "mime";
export const _ = {
url: "/_prasi/**",
@@ -20,6 +21,8 @@ export const _ = {
if (gz) {
const path = parts.slice(1).join("/");
if (gz.code.site[path]) {
const type = mime.getType(path);
if (type) res.setHeader("content-type", type);
res.send(
gz.code.site[path],
req.headers.get("accept-encoding") || ""