title: XMLHttpRequest and S3, CORS error
body: <p>I host my photos on S3 bucket. I added CORS configuration for S3 bucket: </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;ExposeHeader&gt;Accept-Ranges&lt;/ExposeHeader&gt;
   &lt;ExposeHeader&gt;Content-Range&lt;/ExposeHeader&gt;
   &lt;ExposeHeader&gt;Content-Encoding&lt;/ExposeHeader&gt;
   &lt;ExposeHeader&gt;Content-Length&lt;/ExposeHeader&gt;
   &lt;ExposeHeader&gt;Access-Control-Allow-Origin&lt;/ExposeHeader&gt;
   &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
  &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>In my html page, I tried to save image, so I am using the library: <a href="https://github.com/tsayen/dom-to-image" rel="noreferrer">https://github.com/tsayen/dom-to-image</a></p>
  
  <pre><code>domtoimage.toBlob(document.getElementById('my-node'))
  .then(function (blob) {
      window.saveAs(blob, 'my-node.png');
  });
  </code></pre>
  
  <p>I got the CORS error: </p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load
    <a href="http://s3/bucket/path/image.png" rel="noreferrer">http://s3/bucket/path/image.png</a>.
    No 'Access-Control-Allow-Origin' header is present on the requested
    resource.</p>
  </blockquote>
  
  <p>Any Suggestion is appreciated.</p>