Content-Type:图片的可靠性? [英] Reliability of Content-Type: image?

查看:63
本文介绍了Content-Type:图片的可靠性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果页面的内容类型是图像,则标题实际上指示它是图像有多可靠?我是否应该将此作为确定页面(URL)是否为图像的唯一方法?

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?

推荐答案

好消息是,我经常看到内容类型错误的图像,而不是非图像.图片内容类型.因此,我认为图片"内容类型是一个很好的指标.

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?

这篇关于Content-Type:图片的可靠性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆