Skip to content

Commit 47d0d13

Browse files
committed
fix(shell): server: use empty obj instead of JSON.parse() when no content
1 parent 30229d6 commit 47d0d13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/shell/src/satori/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ function buildRouteCtx(
336336

337337
const string = () => buffer().then((b) => b.toString('utf-8'))
338338

339-
const json = () => string().then((s) => JSON.parse(s) as unknown)
339+
const json = () => string().then((s) => (s ? (JSON.parse(s) as unknown) : {}))
340340

341341
return {
342342
cctx,

0 commit comments

Comments
 (0)