From 668c51d250006bd97ae9fcaecb04ea2cf18e53bb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Jul 2014 05:01:48 -0400 Subject: [PATCH] fix(rest) unzip: if !to --- lib/server/rest.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/server/rest.js b/lib/server/rest.js index 0d641476..f22ea114 100644 --- a/lib/server/rest.js +++ b/lib/server/rest.js @@ -361,10 +361,11 @@ if (!files.from) { sendError(params, p.data); } else { - from = mellow.convertPath(files.from); - to = mellow.convertPath(files.to); + from = mellow.convertPath(files.from); - if (!to) + if (files.to) + to = mellow.convertPath(files.to); + else to = Util.rmStrOnce(files.from, ['.zip', '.gzip']); pack.gunzip(from, to, function(error) {