From 3096cb7be51fe6eb60428f4d947ed1a26d72e836 Mon Sep 17 00:00:00 2001 From: Maikel Date: Mon, 9 Dec 2024 17:47:57 +0100 Subject: [PATCH] fix: server functions x-forwarded-host multiple values --- packages/next/src/server/app-render/action-handler.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/next/src/server/app-render/action-handler.ts b/packages/next/src/server/app-render/action-handler.ts index 35225d2334e252..58d4286f5feeca 100644 --- a/packages/next/src/server/app-render/action-handler.ts +++ b/packages/next/src/server/app-render/action-handler.ts @@ -488,9 +488,7 @@ export async function handleAction({ ? new URL(req.headers['origin']).host : undefined - const forwardedHostHeader = req.headers['x-forwarded-host'] as - | string - | undefined + const forwardedHostHeader = req.headers['x-forwarded-host']?.[0] const hostHeader = req.headers['host'] const host: Host = forwardedHostHeader ? {