【问题标题】:CORS on an S3 BucketS3 存储桶上的 CORS
【发布时间】: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


    【解决方案1】:

    Chrome 不喜欢 localhost + CORS :)

    看看this SO 答案。 希望能解决您的问题。

    【讨论】:

      猜你喜欢
      • 2015-12-07
      • 2021-03-31
      • 2017-09-21
      • 2020-06-15
      • 1970-01-01
      • 2021-12-28
      • 1970-01-01
      • 2019-11-17
      • 2019-01-24
      相关资源
      最近更新 更多