CORS stops working exactly 1 week later
Hi, I've been developing a product catalog for a client, and I recently finished it. In the first week, the website was working perfectly, but after two weeks, it stopped and started giving me CORS errors. I fixed the issue in the code, and it worked, but after another two weeks, the same error occurred again:
Access to XMLHttpRequest at 'https://example.up.railway.app/product' from origin 'https://www.example.com.br' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Is this issue with my API, or is it a configuration problem in Railway?
Initially, my CORS policy only allowed requests from www.example.com. Later, I changed it to allow requests from any origin (*). Now, neither approach seems to work. What should I do?
Solution:Jump to solution
cors is not likely the root issue here, the issue is most likely that you are being returned an error page that simply doesnt have cors headers
12 Replies
Project ID:
N/A
n/a
Solution
cors is not likely the root issue here, the issue is most likely that you are being returned an error page that simply doesnt have cors headers
i've redeploy the website and now it's fine, the same page, the same product
please see my previous message
i see
this is the error
but it's an railway or my configs?
its you, please do not use nodemon in production
ok
you should also be connecting to the database over the private network
thanks