以下请求适用于 Firefox,但不适用于 Chrome:
$.ajax({
url:'http://pucquepariu.s3.amazonaws.com/exercicios/1/INF1005-Site-1-1-solucao.c?1366303788',
success:function(data){
alert(data)
}
})
这是我在 Amazon AWS S3 存储桶上的 CORS 配置:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>Content-Type,Depth,User-Agent,X-File-Size,X-Requested-With,If-Modified-Since,X-File-Name,Cache-Control</AllowedHeader>
</CORSRule>
</CORSConfiguration>