I have the following S3 bucket: http://my-bucket.s3-website-eu-west-1.amazonaws.com/
I added the CORS configuration, according to http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html :
<CORSConfiguration>
<CORSRule>
<AllowedHeader>x-requested-with</AllowedHeader>
<AllowedHeader>*</AllowedHeader>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>POST</AllowedMethod>
</CORSRule>
<CORSRule>
<AllowedOrigin>http://*.test.com</AllowedOrigin>
<AllowedMethod>POST</AllowedMethod>
</CORSRule>
</CORSConfiguration>
I am making an AJAX Post request in my bucket using jquery (note, origin is jd.test.com:8000):
$.ajax('http://my-bucket.s3-website-eu-west-1.amazonaws.com/', {
type: "POST",
data: $(":hidden", self).serializeArray(),
files: $(":file", self),
statusCode: {
204: function(){
}
}
});
After completing the request, my chrome console complains:
XMLHttpRequest cannot load http://my-bucket.s3-website-eu-west-1.amazonaws.com/. Origin http://www.jd.test.com:8000 is not allowed by Access-Control-Allow-Origin.
Any help regarding why the POST request is not being executed will be appreciated.
Thank!
source
share