Код: Выделить всё
string? origins = "origins";
builder.Services.AddCors(options =>
{
options.AddPolicy(origins,
policy =>
{
policy.WithOrigins("http://localhost:9999")
.AllowAnyHeader()
.AllowAnyMethod();
});
});
app.UseCors(origins);
< /code>
Но это все еще отображается в консоли браузера: < /p>
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
Подробнее здесь: https://stackoverflow.com/questions/721 ... p-with-con