我使用 libmagic 在我的项目的 Web 界面中获取文件的 mime 类型。我在 css 和 js 文件上获得 text/plain mime 类型。
例如铬显示以下警告:
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
...
我怎样才能解决这个问题?