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

superagent

Package Overview
Dependencies
Maintainers
1
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.5.0 to 0.5.1

test.js

7

History.md
0.5.1 / 2012-07-16
==================
* add "methods" dep
* add `.end()` arity check to node callbacks
* fix unzip support due to weird node internals
0.5.0 / 2012-06-16

@@ -3,0 +10,0 @@ ==================

29

lib/node/index.js

@@ -17,3 +17,3 @@

, format = require('url').format
, methods = require('./methods')
, methods = require('methods')
, utils = require('./utils')

@@ -56,3 +56,3 @@ , Part = require('./part')

mime.define({
'application/x-www-form-urlencoded': ['form']
'application/x-www-form-urlencoded': ['form', 'urlencoded', 'form-data']
});

@@ -126,3 +126,3 @@

this.on('response', function(res){
self.callback(res);
self.callback(null, res);
});

@@ -386,3 +386,3 @@ }

this.emit('redirect', res);
this.end(this.callback);
this.end(this._callback);
return this;

@@ -476,2 +476,17 @@ };

/**
* Invoke the callback with `err` and `res`
* and handle arity check.
*
* @param {Error} err
* @param {Response} res
* @api private
*/
Request.prototype.callback = function(err, res){
var fn = this._callback;
if (2 == fn.length) return fn(err, res);
fn(res); // TODO: emit error
};
/**
* Initiate request, invoking callback `fn(err, res)`

@@ -493,3 +508,3 @@ * with an instanceof `Response`.

// store callback
this.callback = fn || noop;
this._callback = fn || noop;

@@ -527,3 +542,3 @@ // body

if (/^(deflate|gzip)$/.test(res.headers['content-encoding'])) {
utils.unzip(res);
utils.unzip(req, res);
}

@@ -546,3 +561,3 @@

self.emit('end');
self.callback(response);
self.callback(null, response);
});

@@ -549,0 +564,0 @@ return;

@@ -86,7 +86,8 @@

*
* @param {http.ServerResponse} response stream
* @param {Request} req
* @param {Response} res
* @api private
*/
exports.unzip = function(res){
exports.unzip = function(req, res){
if (!zlib) return;

@@ -98,2 +99,5 @@

// make node responseOnEnd() happy
decodedStream.req = req;
// pipe to unzip

@@ -100,0 +104,0 @@ res.pipe(unzip);

{
"name": "superagent"
, "version": "0.5.0"
, "description": "elegant progressive ajax client"
, "version": "0.5.1"
, "description": "elegant & feature rich browser / node HTTP with a fluent API"
, "keywords": ["http", "ajax", "request", "agent"]
, "author": "TJ Holowaychuk <tj@vision-media.ca>"
, "repository": { "type": "git", "url": "git://github.com/visionmedia/superagent.git" }
, "dependencies": {

@@ -12,5 +13,6 @@ "qs": "0.4.2"

, "emitter-component": "0.0.1"
, "methods": "0.0.1"
}
, "devDependencies": {
"express": "2.5.x"
"express": "3.0.0beta5"
, "should": "*"

@@ -17,0 +19,0 @@ , "mocha": "*"

@@ -87,2 +87,6 @@ # SuperAgent

## Wiki
For superagent extensions such as couchdb and oauth visit the [wiki](https://github.com/visionmedia/superagent/wiki).
## License

@@ -89,0 +93,0 @@

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