I create a new S3 bucket with default settings and add this CORS policy:
[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]
I then use this script to test a preflight request:
curl -X OPTIONS -H "Origin: http://example.com" \ -H "Access-Control-Request-Method: GET" \ -I "https://<bucketname>.s3.amazonaws.com/test.mp4"`
To sum up my confusion:
Ok I solved this myself.
I didn't realize the S3 urls have a region part.
https://<bucketname>.s3.amazonaws.com/test.mp4
This defaults to us-east-1
https://<bucketname>.s3.<region>.amazonaws.com/test.mp4
This works better
You are not logged in. Log in to post an answer.
A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.
Ok I solved this myself.
I didn't realize the S3 urls have a region part.
https://<bucketname>.s3.amazonaws.com/test.mp4
This defaults to us-east-1
https://<bucketname>.s3.<region>.amazonaws.com/test.mp4
This works better