Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...