title: Prototype.js 1.4.0 throws 'Refused to set unsafe header "Connection"' Error
body: <p>I am trying to <strong>override</strong> <code>prototype.js</code> by adding in <code>setRequestHeaders</code> function <code>if()</code> with <code>continue;</code> to avoid specified <strong>Header</strong>:</p>
  
  <pre><code>for (var i = 0; i &lt; requestHeaders.length; i += 2){
       if("Connection" === requestHeaders[i] || "Connection" === requestHeaders[i+1])
              continue;
       this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
    }
  </code></pre>
  
  <p>On IE9 this works properly without changes to <code>prototype.js</code>, but in other browsers (Chrome, Firefox etc.) the error in title occurs..</p>
  
  <p>Thanks for any advice and help! :)</p>
  
  <p>[EDIT]</p>
  
  <p>Concerning duplication:
  I found this topic, but it's not same. In duplicated topic there's a file which could be modified, but I cannot modify the code of <code>prototype.js</code>.</p>
  
  <p>[EDIT2]</p>
  
  <p>This code is in 1.4.0 (as written in the title), line about 661-685</p>
  
  <pre><code>setRequestHeaders: function() {
  var requestHeaders =
    ['X-Requested-With', 'XMLHttpRequest',
     'X-Prototype-Version', Prototype.Version];
  
  if (this.options.method == 'post') {
    requestHeaders.push('Content-type',
      'application/x-www-form-urlencoded');
  
    /* Force "Connection: close" for Mozilla browsers to work around
     * a bug where XMLHttpReqeuest sends an incorrect Content-length
     * header. See Mozilla Bugzilla #246651.
     */
    if (this.transport.overrideMimeType)
      requestHeaders.push('Connection', 'close');
  }
  
  if (this.options.requestHeaders)
    requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
  
  for (var i = 0; i &lt; requestHeaders.length; i += 2){
      console.log(requestHeaders[i] + " AND " + requestHeaders[i+1]);
      //My edition - BEGIN;
      if("Connection" === requestHeaders[i] || "Connection" === requestHeaders[i+1])
              continue;
      //END;
    this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
    }
  }
  </code></pre>
  
  <p>Thanks! :)</p>