我在我的项目的Web界面中使用libmagic获取文件的MIME类型。在CSS和JS文件上,我获取到text/plain MIME类型。
例如,Chromium显示以下警告:
Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:8000/jquery-ui.css".
Resource interpreted as Script but transferred with MIME type text/plain: "http://localhost:8000/jquery.timers.js".
HTTP 对话框
alex@alex-laptop ~ $ nc localhost 8000
GET /ui.css HTTP/1.1
HTTP/1.1 200 OK
Connection: close
Content-Length: 699
Content-Type: text/plain; charset=us-ascii
Date: Wed, 19 Sep 2012 11:41:48 GMT
...
我该如何修复这个问题?