Skip to content

Commit 35d2397

Browse files
Lauri Piisangcodebytere
authored andcommitted
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: #24173 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent b29b235 commit 35d2397

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

‎lib/_http_outgoing.js‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ function processHeader(self, state, key, value, validate){
409409
functionstoreHeader(self,state,key,value,validate){
410410
if(validate)
411411
validateHeaderValue(key,value);
412-
state.header+=key+': '+escapeHeaderValue(value)+CRLF;
412+
state.header+=key+': '+value+CRLF;
413413
matchHeader(self,state,key,value);
414414
}
415415

@@ -642,13 +642,6 @@ function connectionCorkNT(msg, conn){
642642
}
643643

644644

645-
functionescapeHeaderValue(value){
646-
// Protect against response splitting. The regex test is there to
647-
// minimize the performance impact in the common case.
648-
return/[\r\n]/.test(value) ? value.replace(/[\r\n]+[\t]*/g,'') : value;
649-
}
650-
651-
652645
OutgoingMessage.prototype.addTrailers=functionaddTrailers(headers){
653646
this._trailer='';
654647
varkeys=Object.keys(headers);
@@ -670,7 +663,7 @@ OutgoingMessage.prototype.addTrailers = function addTrailers(headers){
670663
debug('Trailer "%s" contains invalid characters',field);
671664
thrownewERR_INVALID_CHAR('trailer content',field);
672665
}
673-
this._trailer+=field+': '+escapeHeaderValue(value)+CRLF;
666+
this._trailer+=field+': '+value+CRLF;
674667
}
675668
};
676669

0 commit comments

Comments
(0)