From 93cb12d7d935217e8d9e43c5a829cd2538c7038f Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 19 Feb 2026 17:15:58 +0100 Subject: [PATCH] fix(imgproxy): URL-encode plain source URLs - Use encodeURIComponent for source URLs in plain/ format - Prevents 308 redirect loops caused by double-slash normalization - Prevents invalid URL structures for imgproxy --- lib/imgproxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/imgproxy.ts b/lib/imgproxy.ts index 1ae07ab6..29dfba86 100644 --- a/lib/imgproxy.ts +++ b/lib/imgproxy.ts @@ -60,5 +60,5 @@ export function getImgproxyUrl(src: string, options: ImgproxyOptions = {}): stri // Format: /unsafe//plain/[@] const suffix = extension ? `@${extension}` : ''; - return `${baseUrl}/unsafe/${processingOptions}/plain/${absoluteSrc}${suffix}`; + return `${baseUrl}/unsafe/${processingOptions}/plain/${encodeURIComponent(absoluteSrc)}${suffix}`; }