正确的MIME类型的重要性是什么? [英] What is the importance of correct MIME types?

查看:153
本文介绍了正确的MIME类型的重要性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Chrome中,我收到了以下警告:

 资源解释为样式表,但是以MIME类型text / plain传输。 
解释为脚本但通过MIME类型text / html传输的资源。
pngResource解释为图像,但是以MIME类型text / plain传输。

我为什么要关心?或者浏览器不会将浏览器视为主要浏览器的可能性是多少? 解决方案

提供文件使用不正确的MIME类型可能会打开安全漏洞。 这是一个高调的例子。


In my Chrome I am getting these warnings:

Resource interpreted as stylesheet but transferred with MIME type text/plain.
Resource interpreted as script but transferred with MIME type text/html.
pngResource interpreted as image but transferred with MIME type text/plain.

Why should I care? Or what is the probability that there is a browser that wouldn't treat the resource as the main browsers do?

解决方案

Serving files with an incorrect mime type can open up security holes. Here's a high profile example.

这篇关于正确的MIME类型的重要性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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