fix: update next-config remotePatterns to work with http (#1761)

This commit is contained in:
Matti Nannt
2023-12-07 15:37:03 +01:00
committed by GitHub
parent 59936e54a0
commit 8244a5fa48

View File

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