Skip to content

Commit 2f77596

Browse files
committed
http: misc ClientRequest cleanup
PR-URL: #10654 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent 15c6187 commit 2f77596

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/_http_client.js

+2-5
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;
@@ -128,7 +126,7 @@ function ClientRequest(options, cb) {
128126
if (!headersArray) {
129127
if (options.headers) {
130128
var keys = Object.keys(options.headers);
131-
for (var i = 0, l = keys.length; i < l; i++) {
129+
for (var i = 0; i < keys.length; i++) {
132130
var key = keys[i];
133131
self.setHeader(key, options.headers[key]);
134132
}
@@ -154,7 +152,6 @@ function ClientRequest(options, cb) {
154152
}
155153

156154
if (options.auth && !this.getHeader('Authorization')) {
157-
//basic auth
158155
this.setHeader('Authorization', 'Basic ' +
159156
Buffer.from(options.auth).toString('base64'));
160157
}

0 commit comments

Comments
 (0)