Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-browserify

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-browserify - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

9

lib/request.js

@@ -33,2 +33,6 @@ var Stream = require('stream');

var res = new Response;
res.on('close', function () {
self.emit('close');
});
res.on('ready', function () {

@@ -61,2 +65,7 @@ self.emit('response', res);

Request.prototype.destroy = function (s) {
this.xhr.abort();
this.emit('close');
};
Request.prototype.end = function (s) {

@@ -63,0 +72,0 @@ if (s !== undefined) this.body.write(s);

12

lib/response.js

@@ -48,4 +48,4 @@ var Stream = require('stream');

var respType = xhr.responseType.toLowerCase();
if (respType === "blob") return xhr.responseBlob;
if (respType === "arraybuffer") return xhr.response;
if (respType === 'blob') return xhr.responseBlob;
if (respType === 'arraybuffer') return xhr.response;
return xhr.responseText;

@@ -83,3 +83,3 @@ }

try {
this.write(res);
this._emitData(res);
}

@@ -95,3 +95,3 @@ catch (err) {

}
this.write(res);
this._emitData(res);

@@ -102,6 +102,8 @@ if (res.error) {

else this.emit('end');
this.emit('close');
}
};
Response.prototype.write = function (res) {
Response.prototype._emitData = function (res) {
var respBody = this.getResponse(res);

@@ -108,0 +110,0 @@ if (respBody.toString().match(/ArrayBuffer/)) {

{
"name" : "http-browserify",
"version" : "0.1.3",
"version" : "0.1.4",
"description" : "http module compatability for browserify",

@@ -5,0 +5,0 @@ "main" : "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc