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 =>
|
//builder.Services.AddCors(options =>
|
||||||
{
|
//{
|
||||||
options.AddPolicy("DamageAppCorsPolicy", builder =>
|
// options.AddPolicy("DamageAppCorsPolicy", builder =>
|
||||||
{
|
// {
|
||||||
builder.WithOrigins("*")
|
// builder.WithOrigins("*")
|
||||||
.AllowAnyHeader()
|
// .AllowAnyHeader()
|
||||||
.WithMethods("POST") // Allowing only the POST method
|
// .WithMethods("POST") // Allowing only the POST method
|
||||||
.AllowAnyOrigin();
|
// .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.
|
// Add controller services and API Explorer for endpoint discovery.
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
Loading…
Reference in New Issue
Block a user