Skip to content

Commit

Permalink
improve: body send
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Nov 6, 2023
1 parent 143a529 commit c256b02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,6 @@ export function sendResponse(
statusCode = 200,
cache?: number
) {
response.setHeader("Content-Type", "application/json");
// We only want to cache if the status code is 200 and the
// caching time has been defined.
if (statusCode === 200 && sdk.utils.isDefined(cache)) {
Expand All @@ -1270,5 +1269,5 @@ export function sendResponse(
`s-max-age=${cache}, stale-while-revalidate=${cache}`
);
}
return response.status(statusCode).send(body);
return response.status(statusCode).json(body);
}

0 comments on commit c256b02

Please sign in to comment.