稍微漏了点什么

This commit is contained in:
LamGC 2023-01-28 22:07:58 +08:00
parent 347dbe2135
commit 0d4e1368fd
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -83,7 +83,7 @@ export default {
} else if (pathname === "/") { } else if (pathname === "/") {
const userAgent = request.headers.get("User-Agent"); const userAgent = request.headers.get("User-Agent");
if (userAgent != null && userAgent.match(/curl|libcurl/) !== null) { if (userAgent != null && userAgent.match(/curl|libcurl/) !== null) {
return await sendScriptContent(); return await sendScriptContent(baseUrl);
} else { } else {
return new Response("", { return new Response("", {
status: 301, status: 301,
@ -94,7 +94,7 @@ export default {
}); });
} }
} else if (pathname === "/script.sh") { } else if (pathname === "/script.sh") {
return await sendScriptContent(); return await sendScriptContent(baseUrl);
} else { } else {
return new Response("Not found.", { return new Response("Not found.", {
status: 404, status: 404,