Skip to content

Commit 92195d7

Browse files
c-c-eprCopilot
andcommitted
chore: add debug logging for X-ZSend-Event header and comment out background work log
Co-authored-by: Copilot <copilot@github.com>
1 parent ecfd1fc commit 92195d7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/router.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ export async function router(request: Request, env: Env, ctx: ExecutionContext)
55
return new Response('Method Not Allowed', { status: 405 });
66
}
77

8+
//////////////////////////////////////////////
9+
//此段應該在 Zeabur 修復 Bug 後移除
10+
console.log(request.headers.get('X-ZSend-Event'));
11+
if (request.headers.get('X-ZSend-Event') === 'test') {
12+
return new Response('OK!');
13+
}
14+
//////////////////////////////////////////////
15+
816
const secret = env.SECRET_KEY;
917
if (!secret) {
1018
return new Response('Server configuration error: SECRET_KEY is not set', { status: 500 });
@@ -39,7 +47,7 @@ export async function router(request: Request, env: Env, ctx: ExecutionContext)
3947
// 非同步執行
4048
ctx.waitUntil(
4149
(async () => {
42-
console.log('Doing some work in the background...');
50+
// console.log('Doing some work in the background...');
4351
})(),
4452
);
4553
// 回傳成功

0 commit comments

Comments
 (0)