title: Amazon S3 and Cross-Origin Resource Sharing (CORS)
body: <p>Does Amazon S3 allow custom headers? Or am I out of luck?</p>
  
  <pre><code>Access-Control-Allow-Origin: *
  Access-Control-Allow-Methods: POST, GET, OPTIONS
  Access-Control-Allow-Headers: X-SOMETHING
  Access-Control-Max-Age: 1728000
  </code></pre>
  
  <p><strong>Example</strong></p>
  
  <pre><code>var request = new XMLHttpRequest();
  var url = 'http://example.s3.amazonaws.com/templates/welcome.html';
  
  function callOtherDomain(){
  
      request.open('GET', url, true);
      request.withCredentials = "true";
      request.onreadystatechange = handler;
      request.send();
  
  }
  </code></pre>