资源解释为文档,但以MIME类型text / css传输 [英] Resource interpreted as document but transferred with MIME type text/css

查看:1654
本文介绍了资源解释为文档,但以MIME类型text / css传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

资源解释为文档,但以MIME类型text / css 传输



这是Google Chrome检查器中显示的错误。 / p>

该文件是: http://www.doanddare.org/ css / style.css



正在由一个php处理器渲染。



我修复了此错误?



返回的标题是:



请求标题



 接受:application / xml,application / xhtml + xml,text / html; q = 0.9,text / plain; q = 0.8,image / png, /*;q=0.5 
缓存控制:max-age = 0
User-Agent:Mozilla / 5.0(Windows; U; Windows NT 6.1; en-US)AppleWebKit / 534.3 Gecko)Chrome / 6.0.472.63 Safari / 534.3



响应标题



  HTTP / 1.1 200 OK 
日期:Sun,2010年10月10日07:35:04 GMT
服务器:Apache
content- style-type:text / css
Expires:Thu,10 Oct 1030 03:50:23 GMT
Cache-Control:max-age = 631138519,public
Content-Encoding:gzip
Vary:Accept-Encoding
Transfer-Encoding:chunked
Content-Type:text / css
Connection:Keep-Alive

这可能与作为文档发送的请求头文件和作为css文件返回的响应头文件有关吗?



如果是,请如何控制请求标头?



感谢您的帮助。

解决方案

我只看到当我在Chrome上查看特定资源的错误。当我尝试打开一个Javascript文件(.js)时也会发生这种情况。



我的结论是当你在Chrome中打开组件文件(.css,.js) ,它将尝试解释为文档(显示屏幕上的输出),而不是将其解释为其本机MIME类型。



说一个Javascript文件。如果您在Chrome中输入它,则应将其解释为文档(在屏幕上显示输出),而不是Chrome执行脚本(这是其本机MIME类型)。



该消息仅适用于Google Chrome,并且可以忽略,因为它只会在您打开组件文件时显示。


Resource interpreted as document but transferred with MIME type text/css

This is the error that's showing up in Google Chrome Inspector.

The file is: http://www.doanddare.org/css/style.css

It is being rendered by a php processor.

How can I fix this error?

The headers being returned are:

Request Headers

Accept:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Cache-Control:max-age=0
User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3

Response Headers

HTTP/1.1 200 OK
Date: Sun, 10 Oct 2010 07:35:04 GMT
Server: Apache
content-style-type: text/css
Expires: Thu, 10 Oct 2030 03:50:23 GMT
Cache-Control: max-age=631138519, public
Content-Encoding: gzip
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/css
Connection: Keep-Alive

Could it be something to do with the request headers being sent as a document and the response headers returned as a css file?

If so, how should I control the request headers?

Thanks for any help.

解决方案

I only get error that when I view the specific resource on Chrome. This also happens when I try to open a Javascript file (.js).

My conclusion is that when you open a component file (.css, .js) in Chrome, it will try to interpret as document (showing output on the screen), instead of interpreting it as its native MIME type.

Say a Javascript file. If you enter it in Chrome, it should be interpreted as document (showing output on the screen), instead of Chrome executing the script (that's what its native MIME type does).

That message is Google Chrome only and is negligible, as it only appear when you open a component file.

这篇关于资源解释为文档,但以MIME类型text / css传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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