joyent/node — pull request #3991 by substack (2012-09-10 02:29:45+00:00)
Title: removed headers should stay removed

Some headers such as `date`, `transfer-encoding`, `connection`, and `content-length` are special and get inserted automatically in different circumstances. It's very scattered or impossible to tell node *not* to send these headers. Users might expect `res.removeHeader('connection')` to *not* send the connection header but this is not currently the case.

This patch tells node to *not* send the special headers when `res.removeHeader()` has been called with their names. This is useful in circumstances such as [upgraded connections](https://github.com/substack/http-noupgrade) where `transfer-encoding` and `connection` should be turned off.