hemtros
10/16/2019 - 10:31 PM

Enabling Cors for all origin


private string _securityCorsPolicy = "CorsPolicy";

//configure services
services.AddCors(options =>
            {
                options.AddPolicy(_securityCorsPolicy,
                builder =>
                {
                    builder.AllowAnyOrigin()
                           .AllowAnyMethod()
                           .AllowAnyHeader();
                });
            });
            
            
            //configure
            app.UseCors(_securityCorsPolicy);