Skip to content

Commit

Permalink
fix: render json errors for cors requests (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Feb 21, 2023
1 parent a1243e6 commit 71a6e9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function isJsonRequest(event: H3Event) {
hasReqHeader(event, "accept", "application/json") ||
hasReqHeader(event, "user-agent", "curl/") ||
hasReqHeader(event, "user-agent", "httpie/") ||
hasReqHeader(event, "sec-fetch-mode", "cors") ||
event.node.req.url?.endsWith(".json")
);
}
Expand Down

0 comments on commit 71a6e9e

Please sign in to comment.