Reliability of Content-Type: image?

2019-07-28 09:52发布

问题:

If the content type of a page is an image, how reliable is it that the headers will actually indicate that it is an image? Should I use this as the sole method for determining if a page (URL) is an image?

回答1:

The good news is that I've usually seen images with the wrong Content Type more often than I've seen non-images with the image Content Type. So I would that the "image" Content Type is a pretty good indicator.

I'm curious though. If you're already going through the trouble of requesting a resource, what's the big deal with downloading the whole thing to test if it's an image?



标签: http