From 12bd73a916fb33f1757a7fd9f9afa58a7fb7f668 Mon Sep 17 00:00:00 2001 From: jhonsonzhang <371054141@qq.com> Date: Fri, 5 May 2017 23:15:51 +0800 Subject: [PATCH 1/2] fix zlib error of \'Error: unexpected end of file\' --- app/steps/decorateUserRes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/steps/decorateUserRes.js b/app/steps/decorateUserRes.js index 9c53a709..71a6e5b0 100644 --- a/app/steps/decorateUserRes.js +++ b/app/steps/decorateUserRes.js @@ -9,7 +9,9 @@ function isResGzipped(res) { function zipOrUnzip(method) { return function(rspData, res) { - return (isResGzipped(res)) ? zlib[method](rspData) : rspData; + return (isResGzipped(res)) ? zlib[method](rspData, { + finishFlush: zlib.Z_SYNC_FLUSH + }) : rspData; }; } From d14c8c5df2e3d431c52be4edec70647429c18756 Mon Sep 17 00:00:00 2001 From: jhonsonzhang <371054141@qq.com> Date: Sat, 6 May 2017 00:08:23 +0800 Subject: [PATCH 2/2] fix zlib error of \'Error: unexpected end of file\' --- app/steps/decorateUserRes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/steps/decorateUserRes.js b/app/steps/decorateUserRes.js index 71a6e5b0..d1edf530 100644 --- a/app/steps/decorateUserRes.js +++ b/app/steps/decorateUserRes.js @@ -10,7 +10,7 @@ function isResGzipped(res) { function zipOrUnzip(method) { return function(rspData, res) { return (isResGzipped(res)) ? zlib[method](rspData, { - finishFlush: zlib.Z_SYNC_FLUSH + finishFlush: zlib.constants.Z_SYNC_FLUSH }) : rspData; }; }