We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following Program.cs as part of a dotnet 8 web API project:
var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); builder.Logging.AddConsole(); builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddCors(options => { options.AddDefaultPolicy( policy => { policy.AllowAnyHeader(); policy.AllowAnyMethod(); policy.AllowAnyOrigin(); }); }); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseCors(); app.UseAuthorization(); app.MapControllers(); app.Run();
Notice policy.AllowAnyHeader();. If I browse to my API in the latest Google Chrome I get the following headers, but no Access-Control-Allow-Headers.
policy.AllowAnyHeader();
I would expect to be receiving an Access-Control-Allow-Headers value of *
The text was updated successfully, but these errors were encountered:
This issue should be filed in the dotnet/aspnetcore repository as that's where the CORS functionality lives.
Sorry, something went wrong.
No branches or pull requests
I have the following Program.cs as part of a dotnet 8 web API project:
Notice
policy.AllowAnyHeader();
. If I browse to my API in the latest Google Chrome I get the following headers, but no Access-Control-Allow-Headers.I would expect to be receiving an Access-Control-Allow-Headers value of *
The text was updated successfully, but these errors were encountered: