title: Amazon S3 CORS request fails for uploaded files
body: <p>I am using Amazon S3 as backend. I have the bucket correctly configured to allow CORS to anything from my domain. <strong>I have tested that it works for regular files</strong> (ie. uploaded via the Amazon AWS console or with the S3 command line tools).</p>
  
  <p>My app also uploads JSON files itself to the S3 bucket. Interestingly, it needs CORS correctly configured for the upload to succeed. It does and my JSON file is placed into the bucket.</p>
  
  <p>The problem is, when I make a CORS GET request (jquery <code>$.ajax</code>) <strong>for these files I previously uploaded</strong>, the request fails with the typical message </p>
  
  <pre><code>No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p><strong>Please mind that with any other file in the same bucket, same path, that was not uploaded by the application, but from the console or comnmand line tools, the request succeeds.</strong></p>
  
  <p>Why is this happening? </p>
  
  <p>My CORS configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;http://example.com&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;PUT&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;DELETE&lt;/AllowedMethod&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;https://example.com&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;PUT&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;DELETE&lt;/AllowedMethod&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>