C
C#3y ago
khamas

Getting `Cross Origin Read Blocking` in ASP.NET web API when trying to serve an image

Hey, I am getting a "Cross Origin Read Blocking" from chrome on my HTML client when trying to load an image from my API, I have enabled CORS on my API so I don't know what's wrong...
Cross-Origin Read Blocking (CORB) blocked cross-origin response http://localhost:15040/api/files/download/638007366424413760-c84fb47f-0b9f-42e9-8ac0-afc4fa9633af.webp/633d8f6c16797d07a74aa38c with MIME type application/zip. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Cross-Origin Read Blocking (CORB) blocked cross-origin response http://localhost:15040/api/files/download/638007366424413760-c84fb47f-0b9f-42e9-8ac0-afc4fa9633af.webp/633d8f6c16797d07a74aa38c with MIME type application/zip. See https://www.chromestatus.com/feature/5629709824032768 for more details.
3 Replies
khamas
khamasOP3y ago
builder.Services.AddCors(x =>
{
x.AddPolicy(_corsPolicy, p => p
.WithOrigins(
"http://localhost:5126",
"http://localhost:15040")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
});
builder.Services.AddCors(x =>
{
x.AddPolicy(_corsPolicy, p => p
.WithOrigins(
"http://localhost:5126",
"http://localhost:15040")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
});
This is my CORS policy
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
khamas
khamasOP3y ago
yes I did Cross-Origin Read Blocking (CORB) blocked cross-origin response http://localhost:15040/api/files/download/638007366424413760-c84fb47f-0b9f-42e9-8ac0-afc4fa9633af.webp/633d8f6c16797d07a74aa38c with MIME type application/zip. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Want results from more Discord servers?
Add your server