【问题标题】:Static files are interpreted as Documents while having a different MIME type静态文件被解释为具有不同 MIME 类型的文档
【发布时间】:2019-01-29 21:24:58
【问题描述】:

我正在使用 Google App Engine 建立一个静态网站,但我的文件无法正常提供。

示例: https://shawnfunke.appspot.com/images/icon_144x.png

点击这个网址会给你一个Resource interpreted as Document but transferred with MIME type image/png: "https://shawnfunke.appspot.com/images/icon_144x.png". 警告,无法加载 PNG。

https://shawnfunke.appspot.com/css/style.csshttps://shawnfunke.appspot.com/manifest.json 等其他静态文件也会发生同样的情况,但它们仍然有效。

这张图片 显示类型设置为Document 我不知道为什么,但响应 显示了正确的MIME 类型image/png

静态内容应使用预期的类型 /(CSS 文件/图像/JSON 文件)。

这是app.yaml

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html
  secure: always

- url: /privacy
  static_files: www/pages/privacy.html
  upload: www/pages/privacy.html
  secure: always

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)
  secure: always

可以在https://shawnfunke.appspot.com查看网站

我已经尝试过使用 Chrome 稳定版和 Firefox。它在 Google Cloud SDK 的本地开发服务器上运行良好。 这些文件也可以在我的本地 PC 上正确显示,也可以在 https://github.com/ShawnFunke/website/tree/master/www/images 上查看

【问题讨论】:

    标签: google-app-engine web


    【解决方案1】:

    问题似乎已解决。从那以后我没有更改我的app.yaml 和图片,所以很遗憾我不知道真正的问题是什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-30
      • 2012-12-08
      • 2011-04-23
      • 2016-12-20
      • 2016-11-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多