http-browserify
Advanced tools
Comparing version 0.2.2 to 0.3.0
14
index.js
@@ -10,4 +10,16 @@ var http = module.exports; | ||
} | ||
if (!params.host && params.hostname) { | ||
params.host = params.hostname; | ||
} | ||
if (!params.scheme) params.scheme = window.location.protocol.split(':')[0]; | ||
if (!params.host) params.host = window.location.hostname; | ||
if (!params.host) { | ||
params.host = window.location.hostname || window.location.host; | ||
} | ||
if (/:/.test(params.host)) { | ||
if (!params.port) { | ||
params.port = params.host.split(':')[1]; | ||
} | ||
params.host = params.host.split(':')[0]; | ||
} | ||
if (!params.port) params.port = params.scheme == 'https' ? 443 : 80; | ||
@@ -14,0 +26,0 @@ |
@@ -13,3 +13,4 @@ var Stream = require('stream'); | ||
var uri = params.host | ||
self.uri = (params.scheme || 'http') + '://' | ||
+ params.host | ||
+ (params.port ? ':' + params.port : '') | ||
@@ -23,3 +24,3 @@ + (params.path || '/') | ||
params.method || 'GET', | ||
(params.scheme || 'http') + '://' + uri, | ||
self.uri, | ||
true | ||
@@ -26,0 +27,0 @@ ); |
{ | ||
"name": "http-browserify", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "http module compatability for browserify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
619776
54
6656