Problem with CORS : Browser and CURL work but XMLHttpRequest don't : <p>A web server runs on my local network. Let's say on:
<a href="http://192.168.1.12" rel="nofollow noreferrer">http://192.168.1.12</a></p>

<p>When I visit this url with a browser, it's working fine.</p>

<p>When I visit this url with curl (zsh), it's working too:</p>

<p><code>curl -s "http://192.168.1.12/"</code></p>

<p>But when I try with javascript with XMLHttpRequest:</p>

<pre><code>var x = new XMLHttpRequest();
x.open("GET", "http://192.168.1.12/", true);
x.send(null);
</code></pre>

<p>it fails (error message translated):
CORS header "Access-Control-Allow-Origin" is missing.</p>

<p>I cannot modify the server behavior, but I think I don't need to because it's working with curl.
What should I add to my javascript code to make it work?</p>
