removed headers should stay removed #3991

Closed
wants to merge 3 commits into from

5 participants

@substack

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 where transfer-encoding and connection should be turned off.

@aredridel

Good call.

@bnoordhuis
Node.js Foundation member

LGTM. Can you squash the commits and write up a pretty commit log?

@Nodejs-Jenkins

Can one of the admins verify this patch?

@isaacs isaacs was assigned Aug 19, 2013
@isaacs

Landed with much surgery on 5555318.

@isaacs isaacs closed this Aug 19, 2013
@richardlau richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 8, 2015
@misterdjules misterdjules test: fix test-domain-exit-dispose-again
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
d1ba82a
@richardlau richardlau pushed a commit to ibmruntimes/node that referenced this pull request Feb 15, 2016
@misterdjules misterdjules test: fix test-domain-exit-dispose-again
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
da66166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment