Amazon web services S3 CORS响应403

Amazon web services S3 CORS响应403,amazon-web-services,amazon-s3,cors,Amazon Web Services,Amazon S3,Cors,我正在尝试在S3存储桶上启用CORS。以下是我的CORS配置: <CORSConfiguration> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> </CORSRule> </CORSConfiguration> 如果我删除CORS配置,一切正常。我遗漏了什么?这可能是因

我正在尝试在S3存储桶上启用CORS。以下是我的CORS配置:

<CORSConfiguration>
 <CORSRule>
   <AllowedOrigin>*</AllowedOrigin>
   <AllowedMethod>GET</AllowedMethod>
 </CORSRule>
</CORSConfiguration>

如果我删除CORS配置,一切正常。我遗漏了什么?

这可能是因为您没有明确指定允许的标头,这些标头通常在通过CORS进行呼叫时在飞行前请求中发送

理想情况下,您还需要指定浏览器可以缓存这些飞行前请求的最长时间。尝试修改CORS配置以包含以下信息:

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

*
得到
3000
*

不幸的是,我仍然在这个配置中遇到同样的错误。您是否也可以发布您的bucket的访问策略文档?两者之间可能存在冲突。您是在谈论“添加桶策略”按钮下的内容吗?如果是的话,它是空的。你能不能也发布你用来访问你的bucket的代码?或者你只是点击网址?我直接在Chrome中点击网址。
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>