diff options
author | Lauri Piisang <lauri.piisang@pipedrive.com> | 2018-11-06 16:19:07 +0000 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2018-11-13 09:50:07 +0530 |
commit | 117fef45587288b07b39172d73a4c00716e6064d (patch) | |
tree | c24e3f50708eb7f3f3abbc0b0c2015a2a8cf25b2 /lib | |
parent | 6eda924c189e44a36fc97a7cfae41b69483d5bfb (diff) | |
download | android-node-v8-117fef45587288b07b39172d73a4c00716e6064d.tar.gz android-node-v8-117fef45587288b07b39172d73a4c00716e6064d.tar.bz2 android-node-v8-117fef45587288b07b39172d73a4c00716e6064d.zip |
http: remove obsolete function escapeHeaderValue
There are test cases which validate the useful path of the function
never runs the functionality of it is obsoleted by
checkInvalidHeaderChar
PR-URL: https://github.com/nodejs/node/pull/24173
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_http_outgoing.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 67d0090d7d..04a36d2be2 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -409,7 +409,7 @@ function processHeader(self, state, key, value, validate) { function storeHeader(self, state, key, value, validate) { if (validate) validateHeaderValue(key, value); - state.header += key + ': ' + escapeHeaderValue(value) + CRLF; + state.header += key + ': ' + value + CRLF; matchHeader(self, state, key, value); } @@ -642,13 +642,6 @@ function connectionCorkNT(msg, conn) { } -function escapeHeaderValue(value) { - // Protect against response splitting. The regex test is there to - // minimize the performance impact in the common case. - return /[\r\n]/.test(value) ? value.replace(/[\r\n]+[ \t]*/g, '') : value; -} - - OutgoingMessage.prototype.addTrailers = function addTrailers(headers) { this._trailer = ''; var keys = Object.keys(headers); @@ -670,7 +663,7 @@ OutgoingMessage.prototype.addTrailers = function addTrailers(headers) { debug('Trailer "%s" contains invalid characters', field); throw new ERR_INVALID_CHAR('trailer content', field); } - this._trailer += field + ': ' + escapeHeaderValue(value) + CRLF; + this._trailer += field + ': ' + value + CRLF; } }; |