Skip to content

Commit 656a71e

Browse files
authored
fix(dev): respect opts.json when false for error handler (#3920)
1 parent 301604f commit 656a71e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/runtime/internal/error

src/runtime/internal/error/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function defaultHandler(
6767

6868
// Use HTML response only when user-agent expects it (browsers)
6969
const useJSON =
70-
opts?.json || !event.req.headers.get("accept")?.includes("text/html");
70+
opts?.json ?? !event.req.headers.get("accept")?.includes("text/html");
7171

7272
// Prepare headers
7373
const headers: HeadersInit = {

0 commit comments

Comments
 (0)