fix(images): ensure unoptimized direct serving for uploads proxy routes to prevent 400 bad request
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s
Deploy Canina / deploy (push) Has been cancelled

This commit is contained in:
parsa aghaei committed 2026-09-02 16:10:52 +03:30
1 parent 3aaea0062b
commit 89e59c8427
2 files changed
+8 -1

No files matched your search

+2
View File
@@ -198,6 +198,7 @@ export default function Hero({ banners = [], onShopNavigate }: { banners?: Banne
alt={banner.title || "Canina Pharma Germany"}
fill
priority={idx === 0}
unoptimized={true}
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 600px"
className="object-cover"
/>
@@ -210,6 +211,7 @@ export default function Hero({ banners = [], onShopNavigate }: { banners?: Banne
alt={activeBanner?.title || "Canina Pharma Germany"}
fill
priority
unoptimized={true}
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 600px"
className="object-cover"
/>
@@ -104,7 +104,12 @@ export default function SafeImage({
unoptimized={
isBlobOrData ||
!isAllowedHost ||
(typeof src === 'string' && src.toLowerCase().endsWith('.svg'))
(typeof src === 'string' && (
src.startsWith('/api/uploads/') ||
src.startsWith('/api/media/') ||
src.startsWith('/uploads/') ||
src.toLowerCase().endsWith('.svg')
))
}
className={cn(
"transition-all duration-500 w-full h-full object-contain",