Fix image host whitelist for next
This commit is contained in:
parent
50e9028250
commit
e59d2ef537
@ -1,4 +1,7 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
|
|
||||||
|
const imageUrlParts = process.env.NEXT_PUBLIC_SITE_URL.split("://");
|
||||||
|
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
@ -10,11 +13,13 @@ const nextConfig = {
|
|||||||
{
|
{
|
||||||
protocol: "http",
|
protocol: "http",
|
||||||
hostname: "localhost",
|
hostname: "localhost",
|
||||||
|
port: "3000",
|
||||||
pathname: "/api/files/**",
|
pathname: "/api/files/**",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol: "http",
|
protocol: imageUrlParts[0],
|
||||||
hostname: process.env.NEXT_PUBLIC_SITE_URL,
|
hostname: imageUrlParts[1].split(":")[0],
|
||||||
|
port: "443",
|
||||||
pathname: "/api/files/**",
|
pathname: "/api/files/**",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user