#CORS Only in Localhost

4 messages · Page 1 of 1 (latest)

boreal bramble
#

Error in console
Access to XMLHttpRequest at 'https://localhost:7229/api/test?test=1 from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I only get this error when I run my website and API on my localhost however, if I deploy both and put them on the same server this cors doesn't happen. I'm not really sure what else to include so please request anything and I'll post it. I've been attempting to figure it out for days.

My Web API is
.NET Core Web API (Restless) with .net core 6
Angular version is
Angular 14

scarlet steeple
#

g!cors @boreal bramble

hasty yachtBOT
scarlet steeple
#

Look into the proxy part.