fix: avoid worker exception, graceful 404 (#869)
Some checks are pending
deploy / deploy (push) Waiting to run
publish / publish (push) Waiting to run

This commit is contained in:
Aiden Cline 2025-07-11 04:55:56 -05:00 committed by GitHub
parent 3b9b391320
commit 7e1fc275e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,7 @@ export class SyncServer extends DurableObject<Env> {
}
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url)
const splits = url.pathname.split("/")
const method = splits[1]
@ -275,5 +275,7 @@ export default {
headers: { "Content-Type": "application/json" },
})
}
return new Response("Not Found", { status: 404 })
},
}