title: AJAX call following 302 redirect sets origin to null
body: <p>I'm doing an AJAX call from domain A to domain B.</p>
  
  <p>My domain B checks if A is in the list of allowed domains and sets the <code>Access-Control-allow-Origin</code> to domain A. So far, so good.</p>
  
  <p>Domain B responds to the request by sending a 302 redirect to domain C using the <code>Location</code> header.</p>
  
  <p>The AJAX call follows the redirect to domain C but has the header: <strong><code>Origin: null</code></strong>.</p>
  
  <p>I expected the <code>origin</code> header to be set to domain A,  after following the redirect. </p>
  
  <p>Can anyone explain to me why the origin is set to <code>null</code> instead of to domain A?</p>
  
  <p><strong>Example</strong></p>
  
  <ol>
  <li><p>Request from domain A to B</p>
  
  <pre class="lang-none prettyprint-override"><code>GET / HTTP/1.1
  Host: domain-B.com
  Origin: http://domain-A.com
  </code></pre></li>
  <li><p>Response from domain B :</p>
  
  <pre class="lang-none prettyprint-override"><code>Access-Control-Allow-Origin: http://domain-A.com
  Location: http://domain-C.com
  </code></pre></li>
  <li><p>AJAX call follows the redirect to domain C: </p>
  
  <pre class="lang-none prettyprint-override"><code>GET  HTTP/ 1.1
  Host: domain-C.com
  Origin: null
  </code></pre></li>
  </ol>