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)}`, }, ], },