Access-Control-Allow-Origin is properly set to '*';
Tried using nestjs as backend with the same address, works perfectly fine.
But when using gin, although the header is properly set, still get the error.
What is even more confusing, is that after fetching to the gin server, when I switch back to the nestjs server, it gives me the cors error again. No matter how I refetch.
I have to switch browser from edge to chrome. But as soon as I make a request to the gin server, the error just pop up and won't leave even after switching the backend to nestjs.
Error: localhost/:1 Access to fetch at 'http://localhost:3000/api/record' from origin 'http://localhost:5174' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Any help would be appreciated
Access-Control-Allow-Origin
may be required in the response for the CORS handshake to be successful. But what error message are you getting? Edit your question and add it there (as text, not as a picture).