Skip to content

Commit

Permalink
fix(hono): validator unused cloned response
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Sep 2, 2024
1 parent 600125c commit 349829c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/hono/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,11 +873,9 @@ export const zValidator =
return;
}
const clonedResponse = c.res.clone();
let value: unknown;
try {
value = await clonedResponse.json();
value = await c.res.json();
} catch {
const message = 'Malformed JSON in response';
c.res = new Response(message, { status: 400 });
Expand Down

0 comments on commit 349829c

Please sign in to comment.