title: node.js http.get() makes the request without sending the hostname
body: <p>I have some node.js code that looks like this: </p>
  
  <pre><code>Updater.prototype.poll= function(callback) {
  var options = {
      host: api_host,
      port: 80,
      path: update_path,
      method: 'GET',
      agent: false, 
      headers: [{'accept-encoding': '*;q=1,gzip=0'}]
  };
  
  console.log('Polling');
  var req = http.get(options, function(res) {
      //other stuff here...
  });
  </code></pre>
  
  <p>};</p>
  
  <p>The problem is that when the request is sent, the server returns <code>400 Bad Request - Invalid Hostname</code>. I've sniffed the TCP stream with wireshark and it seems to not be sending the <code>Host</code> part of the http request, but instead generating a line that looks like: <code>undefined: undefined</code> . I'm sure the <code>api_host</code> variable is set correctly (I've even tried with a hardcoded string). I have also tried using <code>hostname</code> instead of <code>host</code> . Is there a known reason it might act this way ?</p>