From 692d346ab2924962abdb2c66cb255473aa27d4f3 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 9 Aug 2021 13:19:38 -0700 Subject: Add access-control-allow-origin header to media responses. --- src/media.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/media.rs') diff --git a/src/media.rs b/src/media.rs index 0704f79..89d70e7 100644 --- a/src/media.rs +++ b/src/media.rs @@ -24,6 +24,9 @@ macro_rules! response_for { 31557600u32, )])); + // Allow CORS + client_resp.set_header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*"); + // Copy all of the relevant S3 headers. $resp.cache_control.map(|v| client_resp.set_header(header::CACHE_CONTROL, v)); $resp.content_disposition.map(|v| client_resp.set_header(header::CONTENT_DISPOSITION, v)); -- cgit v1.2.3