dimanche 28 juin 2015

Why am I getting a CORS error with Rails + AWS S3?

I've uploaded files to an AWS S3 bucket, and I want my app (which is running on a local server) to be able to download files from the bucket. I've spent the last 1.5 hours trying to find a solution, but the answers I found didn't work. I've set my CORS permissions on AWS to the following:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://ift.tt/1f8lKAh">
  <CORSRule>
    <AllowedOrigin>http://localhost:3000</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
  </CORSRule>
</CORSConfiguration>

Does anyone have any ideas? I've also tried setting the 'AllowedOrigin' to *, but this didn't fix the issue either. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire