chore(nuxt): add type for headers (#8326)

This commit is contained in:
Daniel Roe 2022-10-19 14:28:38 +01:00 committed by GitHub
parent 654ddd412a
commit 3333ef8dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,9 +45,11 @@ export default <NitroErrorHandler> async function errorhandler (error: H3Error,
// HTML response (via SSR)
const isErrorPage = event.req.url?.startsWith('/__nuxt_error')
let html = !isErrorPage ? await $fetch(withQuery('/__nuxt_error', errorObject), {
headers: event.req.headers,
}).catch(() => null) : null
let html = !isErrorPage
? await $fetch(withQuery('/__nuxt_error', errorObject), {
headers: event.req.headers as HeadersInit
}).catch(() => null)
: null
// Fallback to static rendered error page
if (!html) {