From d82d145a0b091afbda08c04e021f6d7206c6aaf0 Mon Sep 17 00:00:00 2001 From: Dmitriy <32272181+Kolobok12309@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:03:01 +0300 Subject: [PATCH] fix(nuxt): pass original request headers to the error page (#7340) --- packages/nuxt/src/core/runtime/nitro/error.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/runtime/nitro/error.ts b/packages/nuxt/src/core/runtime/nitro/error.ts index ea557cea492..9000383c235 100644 --- a/packages/nuxt/src/core/runtime/nitro/error.ts +++ b/packages/nuxt/src/core/runtime/nitro/error.ts @@ -45,7 +45,9 @@ export default 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) {