Amazon S3 CORS XMLHttpRequest GET Configuration

I have a static website through Amazon S3, and I have Javascript that will call another domain and parse the XML, JSON, or something else that it receives.

I followed many of the posts on stackoverflow and various blog posts that were related to what was claimed to make it work, but even after following very closely I could not reproduce the results.

 <CORSRule>
   <AllowedOrigin>*</AllowedOrigin>
   <AllowedMethod>GET</AllowedMethod>
 </CORSRule>

I even tried to add a rule without it,

 <AllowedHeader>*</AllowedHeader>

The following link allows you to check if CORS is allowed by sending XMLHttpRequests, and it says that it is not valid, so CORS is not configured or recognized properly.

http://client.cors-api.appspot.com/client/

A possible guide is what Amazon S3 documentation suggests here,

http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETcors.html

, "s3: GetCORSConfiguration", , ...

"": [ "s3: GetObject", "s3: GetCORSConfiguration" ],

" " AWS, , ?

stackexchange ,

HTTP GET to amazon aws jquery XMLHttpRequest Origin Access-Control-Allow-Origin

, , S3, XMLHttpRequests, GET ?

, ... - /? .

+5
3

, , .

CORS , .

CORS S3 example.com S3. example.com.

, , . . , . , .

0

- , , https, . , , .

http:// https://

XMLHttpRequest Amazon S3

0

You must open the access control headers. Try the following:

<CORSRule>
  <AllowedOrigin>*</AllowedOrigin>
  <AllowedMethod>GET</AllowedMethod>
  <ExposeHeader>Access-Control-Allow-Origin</ExposeHeader>
  <ExposeHeader>Access-Control-Allow-Methods</ExposeHeader>
</CORSRule>
0
source

All Articles