We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 826781d commit 5ab0492Copy full SHA for 5ab0492
index.js
@@ -4,8 +4,11 @@ var Request = require('./lib/request');
4
5
http.request = function (params, cb) {
6
if (!params) params = {};
7
- if (!params.host) params.host = window.location.host.split(':')[0];
8
- if (!params.port) params.port = window.location.port;
+ if (!params.host && !params.port) {
+ params.port = parseInt(window.location.port, 10);
9
+ }
10
+ if (!params.host) params.host = window.location.hostname;
11
+ if (!params.port) params.port = 80;
12
if (!params.scheme) params.scheme = window.location.protocol.split(':')[0];
13
14
var req = new Request(new xhrHttp, params);
0 commit comments