Skip to content

Commit 729d2af

Browse files
authored
Fix error when setting header (#32)
1 parent 69e7d86 commit 729d2af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cloudflare/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ export default {
5858
} else {
5959
return new Response("not found", { status: 404 });
6060
}
61-
res.headers.set("Cache-Control", "max-age=600"); // 10 min
61+
if (pathname === "/api/status/up") {
62+
res.setHeader("Cache-Control", "max-age=0"); // no cache
63+
} else {
64+
res.setHeader("Cache-Control", "max-age=600"); // 10 min
65+
}
6266

6367
return res.toResponse();
6468
},

0 commit comments

Comments
 (0)