summaryrefslogtreecommitdiff
path: root/lib/_http_outgoing.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r--lib/_http_outgoing.js39
1 files changed, 16 insertions, 23 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index 79d38db291..5f4e8e2cf1 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -510,18 +510,15 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value) {
const key = name.toLowerCase();
this[outHeadersKey][key] = [name, value];
- switch (key.length) {
- case 10:
- if (key === 'connection')
- this._removedConnection = false;
+ switch (key) {
+ case 'connection':
+ this._removedConnection = false;
break;
- case 14:
- if (key === 'content-length')
- this._removedContLen = false;
+ case 'content-length':
+ this._removedContLen = false;
break;
- case 17:
- if (key === 'transfer-encoding')
- this._removedTE = false;
+ case 'transfer-encoding':
+ this._removedTE = false;
break;
}
};
@@ -583,22 +580,18 @@ OutgoingMessage.prototype.removeHeader = function removeHeader(name) {
var key = name.toLowerCase();
- switch (key.length) {
- case 10:
- if (key === 'connection')
- this._removedConnection = true;
+ switch (key) {
+ case 'connection':
+ this._removedConnection = true;
break;
- case 14:
- if (key === 'content-length')
- this._removedContLen = true;
+ case 'content-length':
+ this._removedContLen = true;
break;
- case 17:
- if (key === 'transfer-encoding')
- this._removedTE = true;
+ case 'transfer-encoding':
+ this._removedTE = true;
break;
- case 4:
- if (key === 'date')
- this.sendDate = false;
+ case 'date':
+ this.sendDate = false;
break;
}