Hi everyone. Is it possible to control CORS settings for the Asset CDN (not the data API)? I would like to upload GeoJSON files as part of my schema and fetch them from my front-end, but at the moment can’t do so due to crossdomain/CORS restriction. Any advice much appreciated. Thanks!
Sep 12, 2022, 10:48 AM
You can't set a CORS domain for the Asset CDN without also setting it for the other Sanity APIs, unfortunately.
Sep 19, 2022, 7:56 PM
Thanks for the reply – that would actually be fine, is it possible (by adding a CORS origin to the data API settings)? I can’t see any CORS headers on asset URL responses at the moment, and I do have a couple of origins configured in the management dashboard 😞
Sep 19, 2022, 8:48 PM
Just found an old issue where someone else is asking about this. If there’s any way to accomplish this I’d love to hear it! For clarity, anything that modifies CORS headers on the Data API as well is fine, but it does appear that the CORS settings in the control panel affect only the Data API and there’s no way to specify CORS origins for the Asset API.
Sep 27, 2022, 5:21 PM
I'll ask internally if there's any follow up for that issue.