无法猜测 mimetype

在测试服务器上goapp serv它可以工作,在 appengine 本身上它会被 application/octet-stream 覆盖。


我怎样才能告诉 appengine 停止这样做?


Could not guess mimetype for home/fonts/FontAwesome.otf. Using application/octet-stream...


我的配置文件:


application: test

version: 0

runtime: go

api_version: go1

threadsafe: true


handlers:

 - url: /home

   static_dir: home


 - url: /home/font/(.*\.woff)

   static_files: home/font/\1

   upload: home/font/(.*\.woff)

   http_headers:

    Content-Type: application/font-woff


 - url: /home/font/(.*\.svg)

   static_files: home/font/\1

   upload: home/font/(.*\.svg)

   http_headers:

    Content-Type: image/svg+xml


 - url: /home/font/(.*\.eot)

   static_files: home/font/\1

   upload: home/font/(.*\.eot)

   http_headers:

    Content-Type: application/vnd.ms-fontobject


 - url: /home/font/(.*\.ttf)

   static_files: home/font/\1

   upload: home/font/(.*\.ttf)

   http_headers:

    Content-Type: application/x-font-ttf


 - url: /home/font/(.*\.otf)

   static_files: home/font/\1

   upload: home/font/(.*\.otf)

   http_headers:

    Content-Type: application/x-font-otf


 - url: /favicon.ico

   static_files: home/favicon.ico

   upload: home/favicon.ico


 - url: /documentation

   static_dir: documentation


 - url: /.*

   script: _go_app


inbound_services:

 - warmup


catspeake
浏览 158回答 2
2回答

阿波罗的战车

还值得注意的是,通用规则应该放在最后,如下所示:handlers:- url: /static/fonts/(.*\.otf)  static_files: static/fonts/\1  upload: static/fonts/(.*\.otf)  mime_type: application/x-font-otf- url: /static/fonts/(.*\.ttf)  static_files: static/fonts/\1  upload: static/fonts/(.*\.ttf)  mime_type: application/x-font-ttf- url: /static  static_dir: static
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go