Skip to content

Commit

Permalink
Merge pull request #299 from giovanni-bertoncelli/master
Browse files Browse the repository at this point in the history
fix: #298: register on close and error event on response
  • Loading branch information
icebob authored Feb 11, 2022
2 parents 65b7add + 759e300 commit c6f16c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ module.exports = {

return new this.Promise(async (resolve, reject) => {
res.once("finish", () => resolve(true));
res.once("close", (err) => reject(err));
res.once("error", (err) => reject(err));

try {
await composeThen.call(this, req, res, ...route.middlewares);
Expand Down

0 comments on commit c6f16c6

Please sign in to comment.