为了账号安全,请及时绑定邮箱和手机立即绑定

无法猜测 mimetype

无法猜测 mimetype

Go
catspeake 2021-06-29 09:15:28
在测试服务器上goapp serv它可以工作,在 appengine 本身上它会被 application/octet-stream 覆盖。我怎样才能告诉 appengine 停止这样做?Could not guess mimetype for home/fonts/FontAwesome.otf. Using application/octet-stream...我的配置文件:application: testversion: 0runtime: goapi_version: go1threadsafe: truehandlers: - 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_appinbound_services: - warmup
查看完整描述

2 回答

?
阿波罗的战车

TA贡献1862条经验 获得超6个赞

还值得注意的是,通用规则应该放在最后,如下所示:


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


查看完整回答
反对 回复 2021-07-12
  • 2 回答
  • 0 关注
  • 153 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信