superagent
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -5,5 +5,5 @@ { | ||
"description": "awesome http requests", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"keywords": ["http", "ajax", "request", "agent"], | ||
"main": "lib/superagent.js" | ||
} |
0.9.4 / 2012-09-20 | ||
================== | ||
* fix `Buffer` responses [TooTallNate] | ||
* fix `res.type` when a "type" param is present [TooTallNate] | ||
0.9.3 / 2012-09-18 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -649,6 +649,6 @@ | ||
// by default only buffer text/*, json, and messed up thing | ||
if (null == buffer && ('text' == type || 'json' == subtype || 'x-www-form-urlencoded' == subtype)) { | ||
buffer = true; | ||
} | ||
// by default only buffer text/*, json | ||
// and messed up thing from hell | ||
var text = 'text' == type || 'json' == subtype || 'x-www-form-urlencoded' == subtype; | ||
if (null == buffer && text) buffer = true; | ||
@@ -660,11 +660,11 @@ // buffered response | ||
res.on('data', function(chunk){ res.text += chunk; }); | ||
} | ||
// parser | ||
var parse = exports.parse[utils.type(res.headers['content-type'] || '')]; | ||
if (parse) { | ||
parse(res, function(err, obj){ | ||
// TODO: handle error | ||
res.body = obj; | ||
}); | ||
// parser | ||
var parse = exports.parse[utils.type(res.headers['content-type'] || '')]; | ||
if (parse) { | ||
parse(res, function(err, obj){ | ||
// TODO: handle error | ||
res.body = obj; | ||
}); | ||
} | ||
} | ||
@@ -811,2 +811,2 @@ | ||
return ~[301, 302, 303, 305, 307].indexOf(code); | ||
} | ||
} |
@@ -68,3 +68,2 @@ | ||
var ct = this.header['content-type'] || ''; | ||
this.type = utils.type(ct); | ||
@@ -75,2 +74,4 @@ // params | ||
this.type = utils.type(ct); | ||
// links | ||
@@ -134,2 +135,2 @@ if (header.link) this.links = utils.parseLinks(header.link); | ||
this.notFound = 404 == status; | ||
}; | ||
}; |
{ | ||
"name": "superagent", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "elegant & feature rich browser / node HTTP with a fluent API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
92070
2737