From 09d3617913eb3b8448ceb85b962d902b575d5eeb Mon Sep 17 00:00:00 2001 From: Mohamed El Amine BOUKERFA Date: Sun, 15 Mar 2026 16:24:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20strip=20whitespace=20fr?= =?UTF-8?q?om=20media=20URLs=20in=20CORS=20proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When exporting a document to PDF, having whitespace before or after the media URL causes the image to not be downloaded via the CORS proxy, resulting in missing images in the exported PDF. Signed-off-by: Mohamed El Amine BOUKERFA --- src/backend/core/api/viewsets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py index 5d9bd360c6..d93118cd13 100644 --- a/src/backend/core/api/viewsets.py +++ b/src/backend/core/api/viewsets.py @@ -2066,7 +2066,7 @@ def cors_proxy(self, request, *args, **kwargs): GET /api/v1.0/documents//cors-proxy Act like a proxy to fetch external resources and bypass CORS restrictions. """ - url = request.query_params.get("url") + url = request.query_params.get("url").strip() if not url: return drf.response.Response( {"detail": "Missing 'url' query parameter"},