diff options
| author | Aiden Cline <[email protected]> | 2025-07-11 04:55:56 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-11 04:55:56 -0500 |
| commit | 7e1fc275e70dcf068370d69f238d7749d5263d9a (patch) | |
| tree | 0d69a9fecddaf7132986a8aabf4b99e1b0b98141 /packages/function/src | |
| parent | 3b9b391320f6ff59dd86970558fff8cd3f215a41 (diff) | |
| download | opencode-7e1fc275e70dcf068370d69f238d7749d5263d9a.tar.gz opencode-7e1fc275e70dcf068370d69f238d7749d5263d9a.zip | |
fix: avoid worker exception, graceful 404 (#869)
Diffstat (limited to 'packages/function/src')
| -rw-r--r-- | packages/function/src/api.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts index a28f286fc..150afd887 100644 --- a/packages/function/src/api.ts +++ b/packages/function/src/api.ts @@ -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 }) }, } |
