mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
fix: 修正中间件以确保在读取index.html之前检查文件是否存在
This commit is contained in:
@@ -186,7 +186,7 @@ async function default_handler(req: Request, ctx: FreshContext) {
|
|||||||
if (!(await exists(p)) || normalize(p) === normalize(swagger_base)) {
|
if (!(await exists(p)) || normalize(p) === normalize(swagger_base)) {
|
||||||
p = join(swagger_base, "/index.html");
|
p = join(swagger_base, "/index.html");
|
||||||
}
|
}
|
||||||
if (basename(p) == "index.html") {
|
if (basename(p) == "index.html" && await exists(p)) {
|
||||||
const html = await Deno.readTextFile(p);
|
const html = await Deno.readTextFile(p);
|
||||||
await initDOMParser();
|
await initDOMParser();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user