Reverted Surveys CORS changes WithOrigins('*')

This commit is contained in:
Santhosh S 2023-11-13 21:24:16 -05:00
parent f00c7dd99c
commit 1fba3e81f1

View File

@ -34,27 +34,12 @@ builder.Services.AddAuthentication(item =>
});
//CORS setup to allow requests from any origin.
//builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => {
// build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().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();
build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin();
}));
// Add controller services and API Explorer for endpoint discovery.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle