0

I have noticed the message "Provisional headers are shown" as in the below image in the developer console. Along with this message, it shows CORS error. web application is built on angular with .NET core 2.2 backend coding. for CORS added below code in starup.cs

 public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddCors(
                options => options.AddPolicy(
                    "localhost",
                    builder => builder
                        .WithOrigins(
                            _appConfiguration["http://localhost:4200,http://localhost:21021"]
                                .Split(",", StringSplitOptions.RemoveEmptyEntries)
                                .Select(o => o.RemovePostFix("/"))
                                .ToArray()
                        )
                        .AllowAnyHeader()
                        .AllowAnyMethod()
                        .AllowCredentials()
                )
        }

 public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseCors("localhost");
        }

enter image description here

0