Skip to content

Commit bae657d

Browse files
author
Jan Kaiser
committed
fix: added missing cleanup, if response socket is no longer writeable
1 parent 7d8955b commit bae657d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/application.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ function respond (ctx) {
221221
// allow bypassing koa
222222
if (ctx.respond === false) return
223223

224-
if (!ctx.writable) return
225-
226224
const res = ctx.res
225+
226+
if (!ctx.writable) return res.end()
227+
227228
let body = ctx.body
228229
const code = ctx.status
229230

0 commit comments

Comments
 (0)