Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): pass original request headers to the error page (#7340)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolobok12309 committed Oct 19, 2022
1 parent fa36ef1 commit d82d145
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nuxt/src/core/runtime/nitro/error.ts
Expand Up @@ -45,7 +45,9 @@ 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)).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
if (!html) {
Expand Down

0 comments on commit d82d145

Please sign in to comment.