Add new settings

This commit is contained in:
2024-03-26 21:17:54 +08:00
parent 867756a70e
commit aa165bf5e4
5 changed files with 130 additions and 3 deletions

View File

@@ -22,6 +22,9 @@ function handle_auth(req: Request, ctx: FreshContext) {
if (u.pathname === "/api/health_check" && req.method === "GET") {
return true;
}
if (m.cfg.random_file_secret && (u.pathname == "/api/file/random" || u.pathname.match(/^\/api\/file\/\d+/) || u.pathname.match(/^\/api\/thumbnail\/\d+/)) && req.method === "GET" && u.searchParams.get("token")) {
return true;
}
return false;
};
if (!token) return check();