title: Edit response headers before piping
body: <p>I have a small proxy for certain requests in Express. Using the <a href="https://github.com/mikeal/request">request</a> library, I have fairly concise code:</p>
  
  <pre><code>app.use('/api', function(req, res) {
      var url = rewriteUrl(req.url);
  
      var newReq = request(url, function(error) {
          if (error) {
              logError(error);
          }
      });
  
      req.pipe(newReq).pipe(res);
  });
  </code></pre>
  
  <p>My problem is that the response from the API server contains a bunch of unwanted headers that I want to remove. How can I remove the headers from the response of <code>newReq</code> before piping it to <code>res</code>?</p>