【发布时间】:2019-02-11 02:57:34
【问题描述】:
我正在使用 Google Cloud Storage 来存储我网站的图片,包括页面的主图片。现在,当我在og:image 标签中使用该图片的 GCS URL 时,Facebook 不会在链接预览中显示该图片。
快速检查 Facebook 的共享调试器会返回此错误:
Invalid content type: https://storage.googleapis.com/moonhope-174701.appspot.com/1548993318172Suasana%20RM%20-%20Kartika%20Abrindah%20Ngantung.jpg ould not be processed as an image because it has an invalid content type.
这是分享它的页面的 URL。注意可能与og:url的内容不同
https://amborjo.com/restaurants/rm-syully-wakeke-f91e076125d411e991cc6db964093b53
我网站中的图片是使用 @google-cloud/storage Node.js 模块上传到 GCS 的,并且已经设置了 contentType 元数据。
如何解决这个错误?
【问题讨论】:
-
一个真实的例子会更好,这个虚构的链接很难帮助
-
@luschn 我已经更新了链接。
-
您也可以添加共享网址吗,该图片在哪里使用?
-
@luschn 我已将页面的 URL 添加到问题中。
-
为什么图片网址中有空格?永远不要那样做……这甚至可能是问题所在,谁知道呢。
标签: node.js google-cloud-storage facebook-opengraph facebook-share