Socket
Socket
Sign inDemoInstall

http-browserify

Package Overview
Dependencies
3
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.1.0

inject.js

4

index.js
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) {

13

package.json
{
"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();
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc