Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5059b76

Browse filesBrowse files
committed
http: misc ClientRequest cleanup
PR-URL: #10654 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
1 parent 44c0e4f commit 5059b76
Copy full SHA for 5059b76

File tree

Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+2-5Lines changed: 2 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.