From 70fe50e153593104c3f184f340ae9730fffcfd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=A0=E9=87=8C?= Date: Thu, 11 Sep 2014 10:33:03 +0800 Subject: [PATCH] bugfix for resBody.length --- lib/requestHandler.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 1bfdf34..4daa2cd 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -185,7 +185,7 @@ function userRequestHandler(req,userRes){ resourceInfo.statusCode = statusCode; resourceInfo.resHeader = resHeader; resourceInfo.resBody = serverResData; - resourceInfo.length = serverResData.length; + resourceInfo.length = serverResData ? serverResData.length : 0; GLOBAL.recorder && GLOBAL.recorder.updateRecord(resourceInfoId,resourceInfo); diff --git a/package.json b/package.json index 045b2bf..651c069 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anyproxy", - "version": "2.3.0", + "version": "2.3.1", "description": "a charles/fiddler like proxy written in NodeJs, which can handle HTTPS requests and CROS perfectly.", "main": "proxy.js", "bin": {