title: XMLHTTPRequest Failed due to CORS Resulting in IP Ban
body: <p>This is my first SO question because I honestly cannot find out the reason for this problem and it's driving me nuts because I can't do testing if I can't reconnect after the 1st failed attempt!</p>
  
  <p>I have a HTML running on my local computer (localhost):</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.open('POST', 'http://hostedDomain.com/myBackendScript.php', true);
  xhr.onload = function (e) {
      console.log(this.responseText);
  };
  xhr.send();
  </code></pre>
  
  <p>On the hosted server (I have no access to <code>php.ini</code>, <code>.htaccess</code>, <code>.httpd.conf</code> etc), <code>myBackendScript.php</code> is simply:</p>
  
  <pre><code>&lt;?php
    header("Access-Control-Allow-Origin: *"); //Note: I am not asking about how to configure Access-Control-Allow-Origin
    echo "Server Response";
  ?&gt;
  </code></pre>
  
  <p>Steps to recreate the problem:</p>
  
  <ol>
  <li>Surf to hostedDomain and it returns the index</li>
  <li>Surf to hostedDomain/myBackendScript.php and it returns "Server Response"</li>
  <li>Run the localhost html, which fails with a CORS error ("Access-Control-Allow-Origin not present, etc" "403 Forbidden" seen in the browser Console) [<strong>Note: I am not asking about how to configure Access-Control-Allow-Origin</strong>]</li>
  <li>Surf to hostedDomain no longer works (connection time-out)</li>
  <li>Switch to another network (change public IP, using same computer) - surf to hostedDomain works again</li>
  <li>Wait a couple of days and I'm able to connect to hostedDomain again.</li>
  </ol>
  
  <p>Note: I am not asking about CORS per se or about how to configure Access-Control-Allow-Origin; I am asking about <strong>why</strong> I am unable to connect to the hostedDomain after the 1st initial failed attempt at XMLHTTPRequest and potential solutions to stop this temporary "ban".</p>
  
  <p>I have a feeling it's got to do with the server configuration; but I have no idea how to proceed further...</p>