Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df18174

Browse filesBrowse 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
Copy full SHA for df18174

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎lib/_http_server.js‎

Copy file name to clipboardExpand all lines: lib/_http_server.js
+3-3Lines 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 = function writeContinue(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
throw new errors.Error('ERR_INVALID_CHAR', 'statusMessage');
232232

233-
var statusLine = 'HTTP/1.1 ' + statusCode + ' ' + this.statusMessage + CRLF;
233+
var statusLine = `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
const badRequestResponse = 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
function socketOnError(e) {
462462
// Ignore further errors

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.