From 8504c0c06a031930dfa389068e91c911b275279d Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Thu, 8 Sep 2022 10:50:02 +0300 Subject: [PATCH] fix(nuxt): Add headers to __nuxt_error request --- 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 896c5179fa4..3c1ddd3727a 100644 --- a/packages/nuxt/src/core/runtime/nitro/error.ts +++ b/packages/nuxt/src/core/runtime/nitro/error.ts @@ -44,7 +44,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) {