Updated WithOrigins(http://localhost:3000) test fix CORS
This commit is contained in:
parent
b7e5e7d7fe
commit
f00c7dd99c
@ -40,16 +40,20 @@ builder.Services.AddAuthentication(item =>
|
||||
|
||||
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("DamageAppCorsPolicy", builder =>
|
||||
{
|
||||
builder.WithOrigins("*")
|
||||
.AllowAnyHeader()
|
||||
.WithMethods("POST") // Allowing only the POST method
|
||||
.AllowAnyOrigin();
|
||||
});
|
||||
});
|
||||
//builder.Services.AddCors(options =>
|
||||
//{
|
||||
// options.AddPolicy("DamageAppCorsPolicy", builder =>
|
||||
// {
|
||||
// builder.WithOrigins("*")
|
||||
// .AllowAnyHeader()
|
||||
// .WithMethods("POST") // Allowing only the POST method
|
||||
// .AllowAnyOrigin();
|
||||
// });
|
||||
|
||||
//});
|
||||
builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => {
|
||||
build.WithOrigins("http://localhost:3000").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin();
|
||||
}));
|
||||
|
||||
// Add controller services and API Explorer for endpoint discovery.
|
||||
builder.Services.AddControllers();
|
||||
|
Loading…
Reference in New Issue
Block a user