I have a website outre.ml. I created two subdomains assets1.outre.ml and assets2.outre.ml for delivering images. However, the images are blocked by the browser’s CORB. This happens because the browser recognises those jpeg images as text/html. How can I change the content type of those images?
You’re right about the CORS issue, but I think you may have the cause and effect mixed up.
The reason you see the
text/html content type is because our server is responding with HTML content instead of this image. The HTML content is provided by this security system:
Because of this security system, embedding content from domains hosted with us onto other websites is not possible. This also happens if they are subdomains of the same domain and/or the domains are on the same hosting account.
The most straight forward way to fix this is simple: don’t use separate subdomains for delivering the images, and upload them directly to the main domain. After all, if you’re serving them from the same hosting account anyways, what’s the point?
Alternatively, you could upgrade to premium hosting, which doesn’t have this restriction, or use an actual CDN to deliver the images (instead of a website account).