-1

I am accessing a markdown file in S3 from a REST API call to AWS API gateway. I have CORS enabled on my endpoint resource and on my S3 bucket as follows:

<?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>

I am still getting:

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.

I have the chrome Moesif CORS extension and everything works if its on. What else can I check?

BTW, whats weird is - everything works fine in FireFox - it appears to just be a chrome thing.

DataGuy
  • 1,695
  • 4
  • 22
  • 38

1 Answers1

0

Chrome does not like localhost + CORS :)

Have a look at this SO answer. Hope that resolves your question.

Chris
  • 268
  • 1
  • 7