From 70044d139b16fca437b1ea35e7ef348e2df2791d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 6 Dec 2021 11:48:27 +0100 Subject: [PATCH] fix(nitro): set content-type header before html 404 (#2301) --- packages/nitro/src/runtime/server/error.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nitro/src/runtime/server/error.ts b/packages/nitro/src/runtime/server/error.ts index e1b98f984d..b38088cd1d 100644 --- a/packages/nitro/src/runtime/server/error.ts +++ b/packages/nitro/src/runtime/server/error.ts @@ -58,5 +58,6 @@ export function handleError (error, req: IncomingMessage, res: ServerResponse) { // HTML response const errorTemplate = is404 ? error404 : (isDev ? errorDev : error500) const html = errorTemplate(errorObject) + res.setHeader('Content-Type', 'text/html;charset=UTF-8') res.end(html) }