-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS Configuration Not Working #512
Comments
I copied your code with insignificant and small change to make the code run in my env, using The CORS just works. You may review if your client makes call to the right endpoint. let configureApp (app : IApplicationBuilder) =
// Using IHostEnvironment
let env = app.ApplicationServices.GetService<IHostEnvironment>()
// Development State can be set via ASPNETCORE_ENVIRONMENT Environment Variable. Checking it here.
let env_state = env.IsDevelopment()
// logger.debug("configureApp()", [env_state], "Environment State, Development:") In my case I do not need to refer to this <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to configure CORS for my backend, but I still get the error:
Access to XMLHttpRequest at 'X' from origin 'Y' 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.
Below is my code which has the proper configuration - as per the documentation and samples:
Also the package is imported like this:
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
Any ideas what I am doing wrong?
Thank you!
The text was updated successfully, but these errors were encountered: