Skip to content

Commit 1d9c89a

Browse files
mscdexitaloacasas
authored andcommitted
http: misc ClientRequest cleanup
PR-URL: nodejs#10654 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent 072e53b commit 1d9c89a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/_http_client.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ function ClientRequest(options, cb) {
9797
var port = options.port = options.port || defaultPort || 80;
9898
var host = options.host = options.hostname || options.host || 'localhost';
9999

100-
if (options.setHost === undefined) {
101-
var setHost = true;
102-
}
100+
var setHost = (options.setHost === undefined);
103101

104102
self.socketPath = options.socketPath;
105103
self.timeout = options.timeout;
@@ -117,7 +115,7 @@ function ClientRequest(options, cb) {
117115
if (!headersArray) {
118116
if (options.headers) {
119117
var keys = Object.keys(options.headers);
120-
for (var i = 0, l = keys.length; i < l; i++) {
118+
for (var i = 0; i < keys.length; i++) {
121119
var key = keys[i];
122120
self.setHeader(key, options.headers[key]);
123121
}
@@ -143,7 +141,6 @@ function ClientRequest(options, cb) {
143141
}
144142

145143
if (options.auth && !this.getHeader('Authorization')) {
146-
//basic auth
147144
this.setHeader('Authorization', 'Basic ' +
148145
Buffer.from(options.auth).toString('base64'));
149146
}

0 commit comments

Comments
 (0)