mirror of
https://github.com/sst/opencode.git
synced 2025-07-24 16:23:43 +00:00
fix: avoid worker exception, graceful 404 (#869)
This commit is contained in:
parent
3b9b391320
commit
7e1fc275e7
1 changed files with 3 additions and 1 deletions
|
@ -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 })
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue