S3 not returning Access-Control-Allow-Origin headers?

前端 未结 4 1017
北海茫月
北海茫月 2020-12-13 06:22

I am having trouble forcing S3 to set CORS headers on all of the objects it returns from a bucket, though CORS is enabled, as client-side S3 uploads is working, the returned

4条回答
  •  时光说笑
    2020-12-13 07:02

    Chrome has this amazing bug which they won't fix:

    If you're lucky enough to have control over the code that is generating the tag you can add crossorigin="anonymous" to the tag.
    Like
    If you can modify either the URL for the tag or the URL for the XHR request, you could add a query parameter to one of them to bypass the cache.
    Like foo.bar/baz.jpg?x-request=xhr.

    Safari has this issue too btw.

提交回复
热议问题