Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

removed headers should stay removed #3991

Closed
wants to merge 3 commits into from
Closed

removed headers should stay removed #3991

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 10, 2012

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
Copy link

Good call.

@bnoordhuis
Copy link
Member

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

@Nodejs-Jenkins
Copy link

Can one of the admins verify this patch?

@ghost ghost assigned isaacs Aug 19, 2013
@isaacs
Copy link

isaacs commented Aug 19, 2013

Landed with much surgery on 5555318.

@isaacs isaacs closed this Aug 19, 2013
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 8, 2015
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: nodejs#3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <[email protected]>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Feb 15, 2016
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: nodejs#3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <[email protected]>
jBarz pushed a commit to ibmruntimes/node that referenced this pull request Nov 4, 2016
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: nodejs#3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants