From b44a1296a051a7ee0528febd3f7dcd325f8b6ad5 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 19 Feb 2026 14:38:09 +0000 Subject: [PATCH] feat: update remote patterns to be more permissive --- apps/web/next.config.js | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 89a52a49..a5105918 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -47,49 +47,13 @@ const config = { remotePatterns: (() => { /** @type {Array<{protocol: "http" | "https", hostname: string}>} */ const patterns = [ - { - protocol: "https", - hostname: - env("S3_FORCE_PATH_STYLE") === "true" - ? `${env("NEXT_PUBLIC_STORAGE_DOMAIN")}` - : `*.${env("NEXT_PUBLIC_STORAGE_DOMAIN")}`, - }, + { protocol: "https", hostname: "**" }, { protocol: "http", hostname: "localhost", }, - { - protocol: "https", - hostname: "*.googleusercontent.com", - }, - { - protocol: "https", - hostname: "cdn.discordapp.com", - }, ]; - // Extract root domain from S3_ENDPOINT and add wildcard pattern - const s3Endpoint = env("S3_ENDPOINT"); - if (s3Endpoint) { - try { - const url = new URL(s3Endpoint); - const hostname = url.hostname; - const protocol = url.protocol.replace(":", ""); - - // Extract root domain (last 2 parts: e.g. cloudflarestorage.com) - const parts = hostname.split("."); - if (parts.length >= 2) { - const rootDomain = parts.slice(-2).join("."); - patterns.push({ - protocol: protocol === "http" ? "http" : "https", - hostname: `*.${rootDomain}`, - }); - } - } catch { - // If S3_ENDPOINT is not a valid URL, ignore it - } - } - return patterns; })(), },