mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-25 01:29:46 +00:00
fix(shell): server: use empty obj instead of JSON.parse()
when no content
This commit is contained in:
parent
30229d65aa
commit
47d0d13e9f
@ -336,7 +336,7 @@ function buildRouteCtx(
|
||||
|
||||
const string = () => buffer().then((b) => b.toString('utf-8'))
|
||||
|
||||
const json = () => string().then((s) => JSON.parse(s) as unknown)
|
||||
const json = () => string().then((s) => (s ? (JSON.parse(s) as unknown) : {}))
|
||||
|
||||
return {
|
||||
cctx,
|
||||
|
Loading…
Reference in New Issue
Block a user