Skip to content

Commit

Permalink
fix missing cleanup, if response socket is no longer writeable (issue…
Browse files Browse the repository at this point in the history
… 1547) (#1593)

Relates to issue #1547, see my [comment
there](#1547 (comment))

Co-authored-by: Jan Kaiser <[email protected]>
Co-authored-by: titanism <[email protected]>
  • Loading branch information
3 people authored Feb 27, 2025
1 parent 5054af6 commit 399cb6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ function respond (ctx) {
// allow bypassing koa
if (ctx.respond === false) return

if (!ctx.writable) return

const res = ctx.res

if (!ctx.writable) return res.end()

let body = ctx.body
const code = ctx.status

Expand Down

0 comments on commit 399cb6b

Please sign in to comment.