Browse files

add top-bodylength compare

  • Loading branch information...
1 parent 16673d1 commit 8f0f5d636ceb19ed7e926b6a50bf25512678a0e5 @e6nian committed Jul 5, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/node-taobao.js
View
5 lib/node-taobao.js
@@ -38,6 +38,11 @@ Client.prototype.getRequest = function(params,callback) {
params.sign = self.createSign(params);
var urlToGet = url.format({ host: self.host ,pathname: self.path ,query:params ,protocol:'http'});
request.get({url:urlToGet}, function (err, res, body) {
+
+ if (parseInt(res.headers.length,10)!==parseInt(body.length,10)){
+ console.log('Lost body content of '+url);
+ return;
+ }
if (res.statusCode !== 200) {
console.log('Request did not return 200. '+url);
return;

0 comments on commit 8f0f5d6

Please sign in to comment.