对于我的s3存储桶,我有一个带有通配符原始规则<AllowedOrigin>*</AllowedOrigin>
的CORs配置文件
我收到此错误
XMLHttpRequest cannot load https://cognito-identity.us-east-1.amazonaws.com/.
Response to preflight request doesn't pass access control check:
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header
when the credentials flag is true.
Origin 'http://localhost:8100' is therefore not allowed access.
所以我将规则更改为<AllowedOrigin>http://localhost:8100</AllowedOrigin>
但是在更改我的CORs配置文件后;我仍然收到上述错误,我的s3响应标题仍显示通配符设置 - Access-Control-Allow-Origin: *
此CORs文件是否缓存在某处?如果是,我如何刷新/重置它,我已经尝试从桶中删除CORs配置,并创建一个新配置,但这并没有解决问题。 我的CORs配置文件(编辑前后)如下所示。
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
我将此更改为
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>http://localhost:8100</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>http://localhost:8100</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
任何帮助都将不胜感激。