title: Does res.writehead actually write to the head of my html page?
body: <p>In my node.js webpage I'm making a page preview similar to the Facebook link preview.  I'm making a call to get the html of the page, and use it to create the preview.</p>
  
  <pre><code>$.ajax({
      type: 'GET',
      data: { "html": url },
      url: "/htmlTest",
      success: function (data) {
              imgArray = [];
              $('img', data).each(function () {
                  imgArray.push(this.src);
              });
    ...
  </code></pre>
  
  <p>This is the server-side code that handles the request.</p>
  
  <pre><code>app.get('/htmlTest', function (req, res) {
      res.writeHead(200, { 'content-type': 'text/html' });
          request(req.query.html, function (error, response, body) {
              if (error) {
                  res.write(error.toString());
                  res.end('\n');
              }
              else if (response.statusCode == 200) {
                  res.write(body);
                  res.end('\n');
              }
          })
  });
  </code></pre>
  
  <p>Now what I've been noticing, is that it will just insert any css the other page uses into my page, which can really screw everything up.  Why is this happening?</p>
  
  <p>Also, while I'm at it, does anyone have any better ideas for a facebook-style page preview?</p>