superagent
Advanced tools
Comparing version 0.4.0 to 0.4.1
0.4.1 / 2012-04-13 | ||
================== | ||
* Added HTTP PATCH support | ||
* Fixed: GET / HEAD when following redirects. Closes #86 | ||
* Fixed Content-Length detection for multibyte chars | ||
0.4.0 / 2012-03-04 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -36,3 +36,3 @@ | ||
exports.version = '0.4.0'; | ||
exports.version = '0.4.1'; | ||
@@ -384,4 +384,8 @@ /** | ||
delete this.req; | ||
this.method = 'HEAD' == this.method | ||
? this.method | ||
: 'GET'; | ||
this._data = null; | ||
this.url = url; | ||
this.emit('redirect', res); | ||
this.url = url; | ||
this.end(this.callback); | ||
@@ -431,3 +435,3 @@ return this; | ||
var self = this | ||
, options = this.options || {} | ||
, options = {} | ||
, data = this._data | ||
@@ -508,3 +512,3 @@ , query = this._query | ||
if (data && !req.getHeader('Content-Length')) { | ||
this.set('Content-Length', data.length); | ||
this.set('Content-Length', Buffer.byteLength(data)); | ||
} | ||
@@ -511,0 +515,0 @@ } |
@@ -688,2 +688,19 @@ | ||
/** | ||
* PATCH `url` with optional `data` and callback `fn(res)`. | ||
* | ||
* @param {String} url | ||
* @param {Mixed} data | ||
* @param {Function} fn | ||
* @return {Request} | ||
* @api public | ||
*/ | ||
request.patch = function(url, data, fn){ | ||
var req = request('PATCH', url); | ||
if (data) req.send(data); | ||
if (fn) req.end(fn); | ||
return req; | ||
}; | ||
/** | ||
* POST `url` with optional `data` and callback `fn(res)`. | ||
@@ -690,0 +707,0 @@ * |
{ | ||
"name": "superagent" | ||
, "version": "0.4.0" | ||
, "version": "0.4.1" | ||
, "description": "elegant progressive ajax client" | ||
@@ -5,0 +5,0 @@ , "keywords": ["http", "ajax", "request", "agent"] |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3
3
81719
21
2481