fix(nuxt): pass original request headers to the error page (#7340)

This commit is contained in:
Dmitriy 2022-10-19 16:03:01 +03:00 committed by GitHub
parent fa36ef1106
commit d82d145a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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