Skip to content

Commit

Permalink
fix: don't render json response if url contains /api/ (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Feb 16, 2023
1 parent be1ac07 commit ee565d3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export function isJsonRequest(event: H3Event) {
hasReqHeader(event, "accept", "application/json") ||
hasReqHeader(event, "user-agent", "curl/") ||
hasReqHeader(event, "user-agent", "httpie/") ||
event.node.req.url?.endsWith(".json") ||
event.node.req.url?.includes("/api/")
event.node.req.url?.endsWith(".json")
);
}

Expand Down

0 comments on commit ee565d3

Please sign in to comment.