Skip to content

Commit 24a1f6e

Browse files
mikealisaacs
authored andcommitted
Fixes https host header default port handling.
1 parent ef35f4d commit 24a1f6e

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

lib/http2.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,7 @@ exports.request = function(options, cb) {
12591259
if (options.agent === undefined) {
12601260
options.agent = globalAgent;
12611261
}
1262+
options.defaultPort = options.defaultPort || 80;
12621263
return new ClientRequest(options, cb);
12631264
};
12641265

lib/https2.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ exports.request = function(options, cb) {
6969
if (options.agent === undefined) {
7070
options.agent = globalAgent;
7171
}
72+
options.defaultPort = options.defaultPort || 443;
7273
return http.request(options, cb);
7374
};
7475

0 commit comments

Comments
 (0)