From 91bc0549c779f836c6b5d143d15d0714f0cf67e1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 13 May 2023 21:25:43 -0500 Subject: [PATCH] sign: 504 --> 408 --- src/sign.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sign.ts b/src/sign.ts index 25b31e53..01430f68 100644 --- a/src/sign.ts +++ b/src/sign.ts @@ -28,6 +28,7 @@ async function signEvent(event: EventTemplate, c: try { return await new Promise>((resolve, reject) => { stream.addEventListener('message', (e) => { + // TODO: parse and validate with zod const data = JSON.parse(e.data); if (data.event === 'nostr.sign') { resolve(JSON.parse(data.payload)); @@ -37,8 +38,8 @@ async function signEvent(event: EventTemplate, c: setTimeout(reject, 60000); }); } catch (_e) { - throw new HTTPException(504, { - res: c.json({ id: 'ditto.timeout', error: 'Signing timeout' }, 504), + throw new HTTPException(408, { + res: c.json({ id: 'ditto.timeout', error: 'Signing timeout' }, 408), }); } }