title: My CORS rule doesn't fix my CORS error
body: <p>I have some CORS rules on my S3 bucket.</p>
  
  <p>This is what it looks like:</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;https://prod-myapp.herokuapp.com/&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;http://prod-myapp.herokuapp.com/&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>When I am in my app, and I try to upload a file (aka...do a POST request) in my JS console, I get this error:</p>
  
  <pre><code>XMLHttpRequest cannot load https://myapp.s3.amazonaws.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://prod-myapp.herokuapp.com' is therefore not allowed access. The response had HTTP status code 403.
  </code></pre>
  
  <p>I attempted to do a POST from my CLI and I got this:</p>
  
  <pre><code>$ curl -v -H "Origin: http://prod-myapp.herokuapp.com" -X POST https://myapp.s3.amazonaws.com
  * Rebuilt URL to: https://myapp.s3.amazonaws.com/
  *   Trying XX.XXX.XX.153...
  * Connected to myapp.s3.amazonaws.com (XX.XXX.XX.153) port 443 (#0)
  * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  * Server certificate: *.s3.amazonaws.com
  * Server certificate: VeriSign Class 3 Secure Server CA - G3
  * Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
  &gt; POST / HTTP/1.1
  &gt; Host: myapp.s3.amazonaws.com
  &gt; User-Agent: curl/7.43.0
  &gt; Accept: */*
  &gt; Origin: http://prod-myapp.herokuapp.com
  &gt; 
  &lt; HTTP/1.1 412 Precondition Failed
  &lt; x-amz-request-id: SOME_ID
  &lt; x-amz-id-2: SOME_ID_2
  &lt; Content-Type: application/xml
  &lt; Transfer-Encoding: chunked
  &lt; Date: Thu, 17 Sep 2015 04:43:28 GMT
  &lt; Server: AmazonS3
  &lt; 
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  * Connection #0 to host myapp.s3.amazonaws.com left intact
  &lt;Error&gt;&lt;Code&gt;PreconditionFailed&lt;/Code&gt;&lt;Message&gt;At least one of the pre-conditions you specified did not hold&lt;/Message&gt;&lt;Condition&gt;Bucket POST must be of the enclosure-type multipart/form-data&lt;/Condition&gt;&lt;RequestId&gt;SOME_ID&lt;/RequestId&gt;&lt;HostId&gt;SOME_HOST_ID&lt;/HostId&gt;&lt;/Error&gt;
  </code></pre>
  
  <p>I just added the CORS rule that applies to the domain I am trying from about 10 - 15 minutes ago. But I was under the impression that it should happen immediately.</p>
  
  <p>Is there some remote cache that I need to bust to get my browser to work? I tried it both in normal mode and in Incognito Mode.</p>
  
  <p>Also, based on the results from <code>curl</code>, it seems as if I am no longer getting an <code>Access-Control-Allow-Origin</code> header error, right? So, theoretically, it should be working in my browser. </p>
  
  <p>Am I misreading what is happening at the command-line?</p>
  
  <p>What else am I missing?</p>