Skip to content

Commit df18174

Browse files
Jayashree S Kumarevanlucas
authored andcommitted
lib: replace string concatenation with template
PR-URL: #16921 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
1 parent a935806 commit df18174

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/_http_server.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ ServerResponse.prototype.detachSocket = function detachSocket(socket) {
176176
};
177177

178178
ServerResponse.prototype.writeContinue=functionwriteContinue(cb){
179-
this._writeRaw('HTTP/1.1 100 Continue'+CRLF+CRLF,'ascii',cb);
179+
this._writeRaw(`HTTP/1.1 100 Continue${CRLF}${CRLF}`,'ascii',cb);
180180
this._sent100=true;
181181
};
182182

@@ -230,7 +230,7 @@ function writeHead(statusCode, reason, obj) {
230230
if(checkInvalidHeaderChar(this.statusMessage))
231231
thrownewerrors.Error('ERR_INVALID_CHAR','statusMessage');
232232

233-
varstatusLine='HTTP/1.1 '+statusCode+' '+this.statusMessage+CRLF;
233+
varstatusLine=`HTTP/1.1 ${statusCode}${this.statusMessage}${CRLF}`;
234234

235235
if(statusCode===204||statusCode===304||
236236
(statusCode>=100&&statusCode<=199)){
@@ -456,7 +456,7 @@ function onParserExecute(server, socket, parser, state, ret, d) {
456456
}
457457

458458
constbadRequestResponse=Buffer.from(
459-
'HTTP/1.1 400 '+STATUS_CODES[400]+CRLF+CRLF,'ascii'
459+
`HTTP/1.1 400 ${STATUS_CODES[400]}${CRLF}${CRLF}`,'ascii'
460460
);
461461
functionsocketOnError(e){
462462
// Ignore further errors

0 commit comments

Comments
 (0)