fix(nitro): set content-type header before html 404 (#2301)

This commit is contained in:
Daniel Roe 2021-12-06 11:48:27 +01:00 committed by GitHub
parent 1c88580c8c
commit 70044d139b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}