Please tell me, I have problems with CORS, I can't make get and other requests, because the api responds without cors headers.
I have already inserted settings for adding cors to the api into the code, deployed the api on iis and inserted cors headers myself, however, when requesting from axios, they are still not there, but when I do request via the browser line they are (in the case of iis).
builder.Services.AddCors(options =>
{
options.AddPolicy(name: myAllowSpecificOrigins,
policy =>
{
policy.WithOrigins("*");
});
});
//another code
app.UseCors(myAllowSpecificOrigins);
What it looks like you want (insecure):
policy.AllowAnyOrigin();
If you want to use wildcards:
policy.WithOrigins( "https://*.domain-a.com", "https://*.domain-b.com" )
.SetIsOriginAllowedToAllowWildcardSubdomains();