尤川豪   ·  3年前
445 貼文  ·  275 留言

Linode 的 object storage 服務有個 CORS 問題呀...

不論是 aws 的 s3

digital ocean 的 spaces

還是 linode 的 object storage

基本上都可以設定開啟 CORS 也就是 Access-Control-Allow-Origin response header

我預期就是一律回應 '*' 最方便

可是根據官方回答

https://www.linode.com/community/questions/21250/access-control-allow-origin-doesnt-appear-in-the-object-storage

I found that the Access-Control-Allow-Origin header for an Object Storage-hosted asset will appear in the response, but only if an Origin is included in your request's headers.

這導致我有少部份用戶 我猜是 browser 的問題 沒有設定好 request header 的 origin

導致 response header 連 * 都沒有,就無法顯示

linode 這樣設計是合理的嗎?

都說 Access-Control-Allow-Origin 是 * 了,應該就要一律回應吧...

這算是 linode 的 bug 吧... 這問題有點嚴重...

  分享   共 976 次點閱
共有 0 則留言
還沒有人留言。歡迎分享您的觀點、或是疑問。
您的留言
尤川豪
445 貼文  ·  275 留言

Devs.tw 是讓工程師寫筆記、網誌的平台。隨手紀錄、寫作,方便日後搜尋!

歡迎您一起加入寫作與分享的行列!

查看所有文章