mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 09:44:21 +01:00
fix: avoid worker exception, graceful 404 (#869)
This commit is contained in:
@@ -108,7 +108,7 @@ export class SyncServer extends DurableObject<Env> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
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 url = new URL(request.url)
|
||||||
const splits = url.pathname.split("/")
|
const splits = url.pathname.split("/")
|
||||||
const method = splits[1]
|
const method = splits[1]
|
||||||
@@ -275,5 +275,7 @@ export default {
|
|||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Response("Not Found", { status: 404 })
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user