From 67aba0efa72ee981c07340c84274306f074b6590 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 1 Nov 2023 01:43:42 +0100 Subject: [PATCH] add Access-Control-Allow-Origin header to /media endpoint --- backend/files/media_urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/files/media_urls.py b/backend/files/media_urls.py index ffff8e5..7184173 100644 --- a/backend/files/media_urls.py +++ b/backend/files/media_urls.py @@ -16,7 +16,8 @@ def media_urls(request, id, format=None): return Response(status=status.HTTP_200_OK, content_type=file.mime_type, headers={ - 'X-Accel-Redirect': f'/redirect_media/{id}' + 'X-Accel-Redirect': f'/redirect_media/{id}', + 'Access-Control-Allow-Origin': '*', }) # TODO Expires and Cache-Control except File.DoesNotExist: