CORS issues the worst. Have not found any working solutions. What am I doing wrong?

Reply to this note

Please Login to reply.

Discussion

Your JavaScript code might be sending requests to a server other than the origin executing it and the server does not signal that it allows that

Just trying to get nip-96 uploads working

You just need to allow them? šŸ˜‚

How?

I guess it depends on you app stack. Usually you can add attribute or tweak Middleware. https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-9.0

Ok will look into it. I’m using supabase

Nice!

If your web app is accessing a endpoint which not signals CORS you need to deploy a cors everywhere proxy: your web app connects to this proxy, that will fetch from the original endpoint and respond to your web app with the CORS headers on, thus fixing the problem.

You can deploy such a proxy in Cloudflare workers (the free tier should be enough) using this code:

https://github.com/Zibri/cloudflare-cors-anywhere