ettorebigm
04/21/2023, 3:19 PMSid | R2
04/21/2023, 3:22 PMettorebigm
04/21/2023, 3:29 PMzegevlier
04/21/2023, 3:33 PMzegevlier
04/21/2023, 3:33 PMcdn.firbuddy.com
, to keep your site but still make the R2 bucket accessible from the web.chumbalaya
04/21/2023, 3:35 PMfeature.my_app.pages.dev
kian
04/21/2023, 3:36 PMkian
04/21/2023, 3:36 PMexample.com
doesn't allow foo.example.com
chumbalaya
04/21/2023, 3:37 PMettorebigm
04/21/2023, 3:48 PMettorebigm
04/21/2023, 3:49 PMzegevlier
04/21/2023, 4:19 PMzegevlier
04/21/2023, 4:19 PMettorebigm
04/21/2023, 4:42 PMSid | R2
04/21/2023, 4:57 PMSid | R2
04/21/2023, 4:57 PMSid | R2
04/21/2023, 4:58 PMettorebigm
04/21/2023, 4:59 PMettorebigm
04/21/2023, 5:00 PMharris
04/21/2023, 11:58 PMts
const handleVideoDownload = () => {
const xhr = new XMLHttpRequest();
const fileName = videoURL.split('/').pop();
xhr.open('GET', videoURL);
xhr.responseType = 'blob';
xhr.onload = () => {
const url = URL.createObjectURL(xhr.response);
const anchor = document.createElement('a');
anchor.href = url;
anchor.download = fileName || '';
document.body.appendChild(anchor);
anchor.click();
document.body.removeChild(anchor);
URL.revokeObjectURL(url);
};
xhr.send();
};
but I get a CORS error:
Access to XMLHttpRequest at '<link>' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Karew
04/22/2023, 12:01 AMharris
04/22/2023, 12:05 AMSid | R2
04/22/2023, 12:23 AMKarew
04/22/2023, 12:24 AM*
for Allowed Origins, I guess?Karew
04/22/2023, 12:25 AMharris
04/22/2023, 1:07 AMharris
04/22/2023, 1:07 AMharris
04/22/2023, 1:07 AMErisa | Support Engineer
04/22/2023, 2:14 AMNo 'Access-Control-Allow-Origin' header is present on the requested resource.
means exactly that, the header wasnt on the response - whether thats because the header went missing or because the request never made it where it was supposed to go, who knows