Custom domain creates CORS issue

Hi,

I recently had a custom domain applied to my application but it has had the effect of causing CORS issues. My app uses papaparse to load in a csv stored in file manager … but now because my app is https://xxx.com and the file is found at https://api.fliplet.com I get cross origin issues:

Access to XMLHttpRequest at 'https://api.fliplet.com/v1/media/files/xxx/xxx/Test.csv from origin ‘https://xxx.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Please help.

Thanks
Andy

Hi Andy,

We have recently released a bug fix for this where if you used our authentication endpoint from a live app (not from inside Fliplet Studio) it will return a file with your custom domain.

Try to use, before giving it to Papa Parse:

var authenticatedUrl = Fliplet.Media.authenticate(mediaFile.url);

Documentation: Media JS APIs | Fliplet Developers Documentation

Thanks,
Deb