Skip to content

Commit 5059b76

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 44c0e4f commit 5059b76

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
@@ -95,9 +95,7 @@ function ClientRequest(options, cb) {
9595
var port = options.port = options.port || defaultPort || 80;
9696
var host = options.host = options.hostname || options.host || 'localhost';
9797

98-
if (options.setHost === undefined) {
99-
var setHost = true;
100-
}
98+
var setHost = (options.setHost === undefined);
10199

102100
self.socketPath = options.socketPath;
103101
self.timeout = options.timeout;
@@ -126,7 +124,7 @@ function ClientRequest(options, cb) {
126124
if (!headersArray) {
127125
if (options.headers) {
128126
var keys = Object.keys(options.headers);
129-
for (var i = 0, l = keys.length; i < l; i++) {
127+
for (var i = 0; i < keys.length; i++) {
130128
var key = keys[i];
131129
self.setHeader(key, options.headers[key]);
132130
}
@@ -152,7 +150,6 @@ function ClientRequest(options, cb) {
152150
}
153151

154152
if (options.auth && !this.getHeader('Authorization')) {
155-
//basic auth
156153
this.setHeader('Authorization', 'Basic ' +
157154
Buffer.from(options.auth).toString('base64'));
158155
}

0 commit comments

Comments
 (0)