Chrome CORBS issue with images

Viewed 1088

I have a react webapp that calls an api (that calls another api using fetch) for image urls and renders the images on the screen through img tags.

The issue I'm having is that the images don't load and instead i get a CORB warning in the console.

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://website.com with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

Notice that im having an issue with CORB not CORS A lot of online posts just give the soluton of adding stuff to the headers which may solve CORS issue but i don't believe they solve CORB. In any event, the api i'm using is not mine so i wouldn't be able to add anything server side anyway.

Do i need to add something to my project client side to get this to work? Any ideas would be appreciated.

1 Answers

That happens because the type you requested does not match the data type that is responded from the server. to overcome this try to compare the two. But, if you doesn't have access to target server, You can make a proxy to the destination server. create one more server that will edit the response header from example.com

Example:

Client App => Your proxy server with modified Content-Type header (Ex: http://myproxy.com) => Your destination server (Ex: http://example.com)

Or if you don't want to create a new server and the application is only opened by you personally, you can replace your browser with a version that doesn't yet apply CORBS.

There is no other attempt I know for the client besides that.

Related