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

superagent

Package Overview
Dependencies
Maintainers
7
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superagent - npm Package Compare versions

Comparing version 0.19.1 to 0.20.0

9

History.md

@@ -0,5 +1,12 @@

0.20.0 / 2014-10-02
==================
* Add toJSON() to request and response instances. (yields)
* Prevent HEAD requests from getting parsed. (gjohnson)
* Update debug. (TooTallNate)
0.19.1 / 2014-09-24
==================
* Fix basic auth issue when password is falsey value.
* Fix basic auth issue when password is falsey value. (gjohnson)

@@ -6,0 +13,0 @@ 0.19.0 / 2014-09-24

@@ -821,4 +821,15 @@

var redirect = isRedirect(res.statusCode);
var parser = self._parser
var parser = self._parser;
self.res = res;
if ('HEAD' == self.method) {
var response = new Response(self);
self.response = response;
response.redirects = self._redirectList;
self.emit('response', response);
self.emit('end');
return;
}
if (self.piped) {

@@ -850,3 +861,4 @@ res.on('end', function(){

if (err) return self.callback(err);
var response = new Response(req, res);
var response = new Response(self);
self.response = response;
response.body = fields;

@@ -865,3 +877,4 @@ response.files = files;

if (err) return self.callback(err);
var response = new Response(req, res);
var response = new Response(self);
self.response = response;
response.body = obj;

@@ -908,3 +921,4 @@ response.redirects = self._redirectList;

self.res = res;
var response = new Response(self.req, self.res);
var response = new Response(self);
self.response = response;
response.redirects = self._redirectList;

@@ -925,3 +939,4 @@ self.emit('response', response);

// TODO: unless buffering emit earlier to stream
var response = new Response(self.req, self.res);
var response = new Response(self);
self.response = response;
response.redirects = self._redirectList;

@@ -965,2 +980,17 @@ self.emit('response', response);

/**
* To json.
*
* @return {Object}
* @api public
*/
Request.prototype.toJSON = function(){
return {
method: this.method,
url: this.url,
data: this._data
};
};
/**
* Expose `Request`.

@@ -967,0 +997,0 @@ */

@@ -22,4 +22,3 @@

*
* @param {ClientRequest} req
* @param {IncomingMessage} res
* @param {Request} req
* @param {Object} options

@@ -32,7 +31,8 @@ * @constructor

function Response(req, res, options) {
function Response(req, options) {
Stream.call(this);
options = options || {};
this.req = req;
this.res = res;
var res = this.res = req.res;
this.request = req;
this.req = req.req;
this.links = {};

@@ -207,1 +207,17 @@ this.text = res.text;

};
/**
* To json.
*
* @return {Object}
* @api public
*/
Response.prototype.toJSON = function(){
return {
req: this.request.toJSON(),
header: this.header,
status: this.status,
text: this.text
};
};

4

package.json
{
"name": "superagent",
"version": "0.19.1",
"version": "0.20.0",
"description": "elegant & feature rich browser / node HTTP with a fluent API",

@@ -29,3 +29,3 @@ "scripts": {

"cookiejar": "2.0.1",
"debug": "~1.0.1",
"debug": "~2.0.0",
"reduce-component": "1.0.1",

@@ -32,0 +32,0 @@ "extend": "~1.2.1",

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