Skip to content

Commit 399cb6b

Browse files
AzlondJan Kaisertitanism
authored
fix missing cleanup, if response socket is no longer writeable (issue 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]>
1 parent 5054af6 commit 399cb6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/application.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ function respond (ctx) {
258258
// allow bypassing koa
259259
if (ctx.respond === false) return
260260

261-
if (!ctx.writable) return
262-
263261
const res = ctx.res
262+
263+
if (!ctx.writable) return res.end()
264+
264265
let body = ctx.body
265266
const code = ctx.status
266267

0 commit comments

Comments
 (0)