Search code examples
javascripthtmlcssimage

<img> not working with the url but when I put the url in browser it works


The following image shows as a broken image but when I put the URL in my browser it works fine. After I access the image through my browser VIA url, the image is cached and the image tag starts to work but once I clear my cache the image is broken again. Can someone help me with this issue?

<img src="http://www.rktteam.vastserve.com/Brawlhalla-660x330.png" style="background-color: initial;">

 I don't think its the HTTPS/HTTP mismatch issue. On the left is a broken image with HTTP URL (it works when you access it in your browser). On the right is another image with HTTP but it works even after I clear my cache.

See the full html here. https://www.rkt-team.com/events/32


Solution

  • When the browser requests the image, what the server returns is not an image at all - the MIME type is returned as text/html.

    Content Type: text/html

    Investigate the server if you want to find out why it's doing it.