Open ivyrze opened 4 months ago
It looks like Mux API requests (like the one used here to fetch available assets) do not allow for client-side requests. I've just come across this bug, but have not used this feature in the past - I'm wondering if it ever worked in the first place?
I'm not sure how this can be fixed without creating our own server-side endpoint for making secure requests --- and a way to tell this plugin what that endpoint is.
My guess is it got overlooked because it seems to work fine when running on the dev server.
The Sanity team has done exactly that in the past — creating Content Lake endpoints to proxy the Mux API requests (e.g. https://<projectId>.api.sanity.io/.../addons/mux/assets
). Ideally we could do that again, but since the Content Lake is closed-source, we will need some help from the maintainers. This has been a bottleneck for #372/#52 as well.
Describe the bug
Trying to import videos into Sanity (as opposed to uploading directly through the plugin) fail with the message:
Checking the console, I can see that it's due to the request being called client-side:
After disabling CORS checks in my browser, everything works as expected.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Videos should be available to import without error.
Which versions of Sanity are you using?
Run
sanity versions
in the terminal and copy-paste the result here.What operating system are you using?
macOS 14.5
Which versions of Node.js / npm are you running?
Run
npm -v && node -v
in the terminal and copy-paste the result here.