Skip to content

Commit

Permalink
fix When rendering a pass through a response, the callback never gets…
Browse files Browse the repository at this point in the history
… called on success: assaf#12
  • Loading branch information
gongxiancao committed Aug 16, 2017
1 parent 3623c34 commit 3b7f373
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ Pass.prototype.pipe = function(output) {
self.emit("error", lastError);
} else {
process.nextTick(function() {
zip.on("end", function() {
self.emit("end");
});
zip.on("error", function(error) {
self.emit("error", error);
});
self.signZip(zip, manifest, function(error) {
if (error) {
return self.emit("error", error);
}
zip.close();
zip.on("end", function() {
self.emit("end");
});
zip.on("error", function(error) {
self.emit("error", error);
});
});
});
}
Expand Down Expand Up @@ -342,6 +342,7 @@ Pass.prototype.signZip = function(zip, manifest, callback) {
if (!error) {
// Write signature file
zip.addFile("signature").end(signature);
zip.emit("end");
}
callback(error);
});
Expand Down

0 comments on commit 3b7f373

Please sign in to comment.