Skip to content

Commit

Permalink
fix: handle JSON body decoding better
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Jun 6, 2022
1 parent 1c311a1 commit 1c84ca9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export class Context<
this.#request,
);
} else {
this.#body = await this.#request.json();
try {
this.#body = await this.#request.json();
} catch {
this.#body = undefined;
}
}
}
return this.#body;
Expand Down

0 comments on commit 1c84ca9

Please sign in to comment.