Skip to content

Commit

Permalink
fix: detection of client premature close
Browse files Browse the repository at this point in the history
Ref: honojs#217
Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
  • Loading branch information
Tomas2D committed Nov 9, 2024
1 parent 350f9b7 commit 48b0e15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ export const getRequestListener = (
outgoing.on('close', () => {
if (incoming.errored) {
req[getAbortController]().abort(incoming.errored.toString())
} else if (incoming.destroyed) {
req[getAbortController]().abort('Client connection prematurely closed.')
}
})

Expand Down

0 comments on commit 48b0e15

Please sign in to comment.