【发布时间】:2020-07-16 22:14:40
【问题描述】:
我正在通过对 AWS API 网关的 REST API 调用访问 S3 中的降价文件。我在端点资源和 S3 存储桶上启用了 CORS,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>http://localhost:4200</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
我仍然得到:
Access to XMLHttpRequest at 'https://xxxxx/page1.md' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我有 chrome Moesif CORS 扩展,如果它打开,一切正常。我还能检查什么?
顺便说一句,奇怪的是 - 在 FireFox 中一切正常 - 它似乎只是一个 chrome 的东西。
【问题讨论】:
标签: amazon-s3 cors aws-api-gateway