Created
March 4, 2024 10:24
-
-
Save shoebsd31/9eb942666d7e1591f492c25e6a244a23 to your computer and use it in GitHub Desktop.
CORS configuration for C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.Services.AddCors(options => | |
{ | |
options.AddPolicy(name: "yourFrontend", | |
policy => | |
{ | |
policy.AllowAnyHeader() | |
.AllowAnyMethod() | |
.AllowCredentials() | |
.WithOrigins("http://localhost:7072"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment