Note that there are some explanatory texts on larger screens.

plurals
  1. POInternet Explorer 11 does not add the Origin header on a CORS request?
    text
    copied!<p>My issue depends on a couple of assumptions I hold true.</p> <h2>Assumption nr 1: The Origin Header</h2> <p>The <code>Origin</code> header is required by the browser to be put on a CORS (Cross Origin Resource Sharing) request.</p> <p><a href="http://en.wikipedia.org/wiki/Cross-origin_resource_sharing">Wikipedia</a>:</p> <blockquote> <p>To initiate a cross-origin request, a browser sends the request with an Origin HTTP header.</p> </blockquote> <p><a href="http://www.html5rocks.com/en/tutorials/cors/">HTML5 Rocks</a>:</p> <blockquote> <p>The first thing to note is that a valid CORS request <em>always</em> contains an Origin header. This Origin header is added by the browser, and can not be controlled by the user.</p> </blockquote> <p><a href="http://www.w3.org/TR/cors/#make-a-request-steps">W3</a>:</p> <blockquote> <p>If the request URL origin is not same origin with the original URL origin, set source origin to a globally unique identifier [..].</p> </blockquote> <h2>Assumption nr 2: Internet Explorer 10+ support CORS</h2> <p>See <a href="http://caniuse.com/cors">caniuse.com</a> and use google for a couple of hundreds more sources of different kinds claiming the support.</p> <h2>Assumption nr 3: Different ports is a different origin</h2> <p>Resources using different port numbers is considered to be of different origins:</p> <p><a href="http://en.wikipedia.org/wiki/Same-origin_policy">Wikipedia</a></p> <blockquote> <p>Two resources are considered to be of the same origin if and only if all these values are exactly the same. [..] Failure - Same protocol and host but different port.</p> </blockquote> <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript">Mozilla Developer Network</a></p> <blockquote> <p>Two pages have the same origin if the protocol, port (if one is specified), and host are the same for both pages.</p> </blockquote> <h2>The problem:</h2> <p>Internet Explorer 11 does not send the <code>Origin</code> header when making a CORS request to the same domain "localhost" but using different ports (from 8411 to 8080). Opera, FireFox and Chrome do send the Origin header. Yet everybody keeps saying CORS is supported in Internet Explorer 10+?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload