From ee565d3fc6ab0a9eab9993180db9820b731a9346 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 16 Feb 2023 22:46:16 +0000 Subject: [PATCH] fix: don't render json response if url contains `/api/` (#951) --- src/runtime/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime/utils.ts b/src/runtime/utils.ts index 3c1ba3f59b..9d58450be2 100644 --- a/src/runtime/utils.ts +++ b/src/runtime/utils.ts @@ -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") ); }