【问题标题】:Displaying an image from AWS S3 with GitHub Flavored Markdown使用 GitHub Flavored Markdown 显示来自 AWS S3 的图像
【发布时间】:2014-04-22 14:48:24
【问题描述】:

我想在 GitHub 问题中显示来自我的 AWS S3 存储桶的图像,但 GitHub 提供的别名源 URL 不起作用。

我的降价:

![test](https://s3-us-west-2.amazonaws.com/gitshoes/screenshot20140422-45272-isuk4x.png)

GitHub 生成的 HTML:

<img src="https://camo.githubusercontent.com/b02d0cf44d4ba89549749d299ca9fcfb50612ee7/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f67697473686f65732f73637265656e73686f7432303134303432322d34353237322d6973756b34782e706e67" alt="test" data-canonical-src="https://s3-us-west-2.amazonaws.com/gitshoes/screenshot20140422-45272-isuk4x.png" style="max-width:100%;">

我提供的图片网址 (data-canonical-src) 有效,但 camo.githubusercontent.com 只是说“未找到”。

我尝试使用不同的图像 URL,因此问题似乎特定于 AWS 图像。我已经公开了我的存储桶的 AWS 图像,所以这也可能不是问题。

【问题讨论】:

    标签: amazon-web-services github amazon-s3 markdown github-flavored-markdown


    【解决方案1】:

    我认为可能是因为内容类型响应标头未设置为 Content-Type: image/png

    如果您打开 chrome 检查器,请转到网络选项卡,然后加载您的图片网址,您会在响应标头中看到它

     Content-Type:
    

    https://i.imgur.com/krwv2oe.jpg 如果你看一下,你会看到它有响应头 content-type:image/jpeg

    您可能需要配置您的 aws 存储桶以返回反映其返回内容的内容类型标头。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-10
      • 2012-08-10
      • 1970-01-01
      • 2018-08-05
      • 2013-08-03
      • 2018-05-05
      • 1970-01-01
      相关资源
      最近更新 更多