summaryrefslogtreecommitdiff
path: root/lib/_http_outgoing.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-12-18 08:56:52 -0500
committerBrian White <mscdex@mscdex.net>2016-12-29 14:18:53 -0500
commit14c76f8671c326d7d4b750fd2cc33b63de7e553e (patch)
tree7d8f619633bfc0d1fb6fcf6b4accbe2bddf45cb7 /lib/_http_outgoing.js
parent175ed520c1db6cb5a386068643f733eb984e1205 (diff)
downloadandroid-node-v8-14c76f8671c326d7d4b750fd2cc33b63de7e553e.tar.gz
android-node-v8-14c76f8671c326d7d4b750fd2cc33b63de7e553e.tar.bz2
android-node-v8-14c76f8671c326d7d4b750fd2cc33b63de7e553e.zip
http: misc cleanup and minor optimizations
PR-URL: https://github.com/nodejs/node/pull/6533 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r--lib/_http_outgoing.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index b85e3c5407..8d134ecc50 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -380,8 +380,7 @@ OutgoingMessage.prototype.getHeader = function getHeader(name) {
if (!this._headers) return;
- var key = name.toLowerCase();
- return this._headers[key];
+ return this._headers[name.toLowerCase()];
};
@@ -585,7 +584,6 @@ OutgoingMessage.prototype.end = function end(data, encoding, callback) {
if (this.connection && data)
this.connection.cork();
- var ret;
if (data) {
// Normal body write.
this.write(data, encoding);
@@ -598,6 +596,7 @@ OutgoingMessage.prototype.end = function end(data, encoding, callback) {
this.emit('finish');
};
+ var ret;
if (this._hasBody && this.chunkedEncoding) {
ret = this._send('0\r\n' + this._trailer + '\r\n', 'latin1', finish);
} else {
@@ -677,8 +676,7 @@ OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
var outputCallbacks = this.outputCallbacks;
socket.cork();
for (var i = 0; i < outputLength; i++) {
- ret = socket.write(output[i], outputEncodings[i],
- outputCallbacks[i]);
+ ret = socket.write(output[i], outputEncodings[i], outputCallbacks[i]);
}
socket.uncork();