From 8244a5fa489fdefb294389e425e4d850fd43635b Mon Sep 17 00:00:00 2001 From: Matti Nannt Date: Thu, 7 Dec 2023 15:37:03 +0100 Subject: [PATCH] fix: update next-config remotePatterns to work with http (#1761) --- apps/web/next.config.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 706969c5a9..3cdeaffbf7 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -4,8 +4,9 @@ import "@formbricks/lib/env.mjs"; /** @type {import('next').NextConfig} */ -function removeHttps(url) { - return url.replace('https://', ''); +function getHostname(url) { + const urlObj = new URL(url); + return urlObj.hostname; } const nextConfig = { @@ -39,7 +40,7 @@ const nextConfig = { }, { protocol: "https", - hostname: `${removeHttps(process.env.WEBAPP_URL)}`, + hostname: `${getHostname(process.env.WEBAPP_URL)}`, }, ], },