Skip to content

Commit fdd3810

Browse files
aredridelJames Halliday
authored andcommitted
Reorder scheme detection to cascade into port detection
1 parent a989787 commit fdd3810

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ http.request = function (params, cb) {
77
if (!params.host && !params.port) {
88
params.port = parseInt(window.location.port, 10);
99
}
10+
if (!params.scheme) params.scheme = window.location.protocol.split(':')[0];
1011
if (!params.host) params.host = window.location.hostname;
1112
if (!params.port) params.port = params.scheme == 'https' ? 443 : 80;
12-
if (!params.scheme) params.scheme = window.location.protocol.split(':')[0];
1313

1414
var req = new Request(new xhrHttp, params);
1515
if (cb) req.on('response', cb);

0 commit comments

Comments
 (0)