Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/next/src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ async function makeApiRoute(

// TODO: Handle plain text and file upload

return new Response(JSON.stringify({ message: 'Invalid request body' }), {
status: 400,
headers: { 'Content-Type': 'application/json' },
})
return Response.json(
{ message: 'Invalid request body' },
{
status: 400,
headers: { 'Content-Type': 'application/json' },
}
)
}

const response = new Response(null, {
Expand Down
Loading