http-browserify
Advanced tools
Comparing version 1.0.2 to 1.1.0
var http = module.exports; | ||
var EventEmitter = require('events').EventEmitter; | ||
var Request = require('./lib/request'); | ||
var url = require('url') | ||
http.request = function (params, cb) { | ||
if (typeof params === 'string') { | ||
params = url.parse(params) | ||
} | ||
if (!params) params = {}; | ||
@@ -7,0 +11,0 @@ if (!params.host && !params.port) { |
{ | ||
"name": "http-browserify", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "http module compatability for browserify", | ||
@@ -12,2 +12,5 @@ "main": "index.js", | ||
}, | ||
"scripts": { | ||
"test": "tape test/*.js" | ||
}, | ||
"dependencies": { | ||
@@ -18,3 +21,4 @@ "Base64": "~0.2.0", | ||
"devDependencies": { | ||
"ecstatic": "~0.1.6" | ||
"ecstatic": "~0.1.6", | ||
"tape": "~2.3.2" | ||
}, | ||
@@ -37,6 +41,3 @@ "repository": { | ||
}, | ||
"license": "MIT/X11", | ||
"engine": { | ||
"node": ">=0.4" | ||
} | ||
"license": "MIT/X11" | ||
} |
@@ -30,3 +30,3 @@ global.window = { | ||
test('Test full url object', function(t) { | ||
var url = { | ||
var url = { | ||
host: "localhost:8081", | ||
@@ -50,2 +50,12 @@ hostname: "localhost", | ||
}); | ||
}); | ||
test('Test string as parameters', function(t) { | ||
var url = '/api/foo'; | ||
var request = http.get(url, noop); | ||
t.equal( request.uri, 'http://localhost:8081/api/foo', 'Url should be correct'); | ||
t.end(); | ||
}) |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
787054
94957
11626
2
16
10