title: Amazon S3, impossible to set CORS Policy
body: <p>I need to setup an S3 bucket to serve my Django static files, and when I try to add a CORS policy, I got the following result:</p>
  <pre><code>Expected params.CORSConfiguration.CORSRules to be an Array 
  </code></pre>
  <p>I firstly tried this policy:</p>
  <pre><code>&lt;CORSConfiguration&gt;
   &lt;CORSRule&gt;
     &lt;AllowedOrigin&gt;http://www.example.com&lt;/AllowedOrigin&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;*&lt;/AllowedOrigin&gt;
     &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
   &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  <p>And after some search I saw that Amazon has changed the format to JSON (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors</a>).</p>
  <p>So I tried with their JSON example:</p>
  <pre><code>{
    &quot;CORSConfiguration&quot;:{
      &quot;CORSRule&quot;:[
        {
          &quot;AllowedOrigin&quot;:[
            &quot;http://www.example.fr&quot;
          ],
          &quot;AllowedMethod&quot;:[
            &quot;PUT&quot;,
            &quot;POST&quot;,
            &quot;DELETE&quot;
          ],
          &quot;AllowedHeader&quot;:[
            &quot;*&quot;
          ]
        },
        {
          &quot;AllowedOrigin&quot;:[
            &quot;*&quot;
          ],
          &quot;AllowedMethod&quot;:[
            &quot;GET&quot;
          ]
        }
      ]
    }
  }
  </code></pre>
  <p>And I got the exact same error.</p>
  <p>So I searched on stackoverflow and saw this thread: <a href="https://stackoverflow.com/questions/64585273/unable-to-update-aws-s3-cors-policy">Unable to update AWS S3 CORS POLICY</a></p>
  <p>I tried the given syntax, without any success :/</p>
  <p>If someone have an idea it will be great :)</p>