| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3b3838d commit f4d3d12
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -502,14 +502,14 @@ function _storeHeader(firstLine, headers) { | |||
| 502 | 502 | const shouldSendKeepAlive = this.shouldKeepAlive && | |
| 503 | 503 | (state.contLen || this.useChunkedEncodingByDefault || this.agent); | |
| 504 | 504 | if (shouldSendKeepAlive) { | |
| 505 | - header += 'Connection: keep-alive\r\n'; | ||
| 505 | + header += 'Connection: keep-alive' + CRLF; | ||
| 506 | 506 | if (this._keepAliveTimeout && this._defaultKeepAlive) { | |
| 507 | 507 | const timeoutSeconds = MathFloor(this._keepAliveTimeout / 1000); | |
| 508 | - header += `Keep-Alive: timeout=${timeoutSeconds}\r\n`; | ||
| 508 | + header += `Keep-Alive: timeout=${timeoutSeconds}${CRLF}`; | ||
| 509 | 509 | } | |
| 510 | 510 | } else { | |
| 511 | 511 | this._last = true; | |
| 512 | - header += 'Connection: close\r\n'; | ||
| 512 | + header += 'Connection: close' + CRLF; | ||
| 513 | 513 | } | |
| 514 | 514 | } | |
| 515 | 515 | ||
@@ -525,7 +525,7 @@ function _storeHeader(firstLine, headers) { | |||
| 525 | 525 | typeof this._contentLength === 'number') { | |
| 526 | 526 | header += 'Content-Length: ' + this._contentLength + CRLF; | |
| 527 | 527 | } else if (!this._removedTE) { | |
| 528 | - header += 'Transfer-Encoding: chunked\r\n'; | ||
| 528 | + header += 'Transfer-Encoding: chunked' + CRLF; | ||
| 529 | 529 | this.chunkedEncoding = true; | |
| 530 | 530 | } else { | |
| 531 | 531 | // We should only be able to get here if both Content-Length and | |
@@ -740,7 +740,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', { | |||
| 740 | 740 | get: function() { return !!this._header; } | |
| 741 | 741 | }); | |
| 742 | 742 | ||
| 743 | - const crlf_buf = Buffer.from('\r\n'); | ||
| 743 | + const crlf_buf = Buffer.from(CRLF); | ||
| 744 | 744 | OutgoingMessage.prototype.write = function write(chunk, encoding, callback) { | |
| 745 | 745 | if (typeof encoding === 'function') { | |
| 746 | 746 | callback = encoding; | |
@@ -903,7 +903,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) { | |||
| 903 | 903 | state.finalCalled = true; | |
| 904 | 904 | ||
| 905 | 905 | if (this._hasBody && this.chunkedEncoding) { | |
| 906 | - this._send('0\r\n' + this._trailer + '\r\n', 'latin1', finish); | ||
| 906 | + this._send('0' + CRLF + this._trailer + CRLF, 'latin1', finish); | ||
| 907 | 907 | } else { | |
| 908 | 908 | // Force a flush, HACK. | |
| 909 | 909 | this._send('', 'latin1', finish); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments