🐛(backend) strip whitespace from media URLs in CORS proxy

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 <boukerfa.ma@gmail.com>
This commit is contained in:
Mohamed El Amine BOUKERFA
2026-04-28 13:47:16 +00:00
committed by GitHub
parent 37091ca804
commit 99764b8e3e
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -2268,7 +2268,7 @@ class DocumentViewSet(
GET /api/v1.0/documents/<resource_id>/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"},