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

前端 未结 4 1037
北海茫月
北海茫月 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:12

    I also ran into this with an tag, and after following Myrne Stol's answer I added the crossorigin=anonymous tag to my image tag. I verified that the Origin header was indeed being sent to S3, but still, the Access-Control-Allow-Origin header was not being sent in response.

    I came across this SO answer and it solved it. I changed the AllowedOrigin in my S3 config to this:

    http://*
    https://*
    

    and now S3 responds with the access headers. Yay!

提交回复
热议问题