diff --git a/components/Image.tsx b/components/Image.tsx index c5fa290cb..accfdb19b 100644 --- a/components/Image.tsx +++ b/components/Image.tsx @@ -24,16 +24,12 @@ function imageLoader({ quality, src, width }: ImageLoaderProps) { const isAbsoluteUrl = src.startsWith("https://") || src.startsWith("http://") const hasQS = src.indexOf("?") !== -1 - if (isAbsoluteUrl) { - if (isBlockedByFirewall(src)) { - return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}` - } else { - return `https://image-scandic-hotels.netlify.app/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` - //return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` //TODO: use this when Daniel fixed DNS in citrix - } + if (!isAbsoluteUrl || isBlockedByFirewall(src)) { + return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}` } - return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}` + return `https://image-scandic-hotels.netlify.app/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` + //return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` //TODO: use this when Daniel fixed DNS in citrix } // Next/Image adds & instead of ? before the params