Google warning: Resource interpreted as Font but transferred with MIME type application/octet-stream

前端 未结 7 1860
时光取名叫无心
时光取名叫无心 2020-11-29 00:20

I have a warning in Google for my font-face:

Resource interpreted as Font but transferred with MIME type application/octet-stream: \".../Content/Fonts/iconFo

7条回答
  •  臣服心动
    2020-11-29 00:59

    If you run a server with nodeJS, this is a nice module to map your mime types

    https://github.com/broofa/node-mime

    var mime = require('mime');
    
    mime.lookup('/path/to/file.txt');         // => 'text/plain'
    mime.lookup('file.txt');                  // => 'text/plain'
    mime.lookup('.TXT');                      // => 'text/plain'
    mime.lookup('htm');                       // => 'text/html'
    
    mime.extension('text/html');                 // => 'html'
    mime.extension('application/octet-stream');  // => 'bin'
    

提交回复
热议问题