Skip to content

Commit

Permalink
Resolves the multiple emit from #280
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Sep 8, 2023
1 parent 4338f34 commit 4c9a15b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ module.exports = class ServerlessResponse extends http.ServerResponse {
return true;
},
});

this.once('finish', () => {
this.emit('close')
});
}

};
1 change: 1 addition & 0 deletions serverless-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = function (app, opts) {
await finish(request, options.request, ...context);
const response = await framework(request);
await finish(response, options.response, ...context);
response.emit('close');
return response;
});
};

0 comments on commit 4c9a15b

Please sign in to comment.