Skip to content

Commit

Permalink
fix: fix createServerResponse memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
nitedani committed Aug 5, 2024
1 parent ea89785 commit c0f3788
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ function createServerResponse(incomingMessage: IncomingMessage) {
}
)

res.once('finish', () => {
passThrough.end()
passThrough.once('finish', () => {
res.emit('finish')
})
passThrough.once('close', () => {
res.emit('close')
})

passThrough.on('drain', () => {
res.emit('drain')
})
Expand Down

0 comments on commit c0f3788

Please sign in to comment.