title: Why length of XMLHttpRequest response differs from size of requested file?
body: <p>If actual size of file is 6327 bytes (and content-length in response header is 6327),</p>
  
  <p>then why length of XMLHttpRequest response (value of xhr.response.length in code below) is different:</p>
  
  <p>6085 in Chrome (Version 41) and 5961 in Firefox (Version 36)?</p>
  
  <pre><code>//run this code somewhere on google.com to avoid access error
  var xhr = new XMLHttpRequest();
  xhr.open('GET','https://www.google.com/images/errors/robot.png',true);
  xhr.onreadystatechange=function(e){
      if(xhr.readyState==4&amp;&amp;xhr.status==200){
          console.log(xhr.response.length);
      }
  };
  xhr.send();
  </code></pre>
  
  <p>Command</p>
  
  <pre><code>xhr.setRequestHeader('Content-Type','image/png');
  </code></pre>
  
  <p>or command</p>
  
  <pre><code>xhr.setRequestHeader('Content-Type','application/zip');
  </code></pre>
  
  <p>does not help.</p>