From bae657d6d2ae52d9b28de3a3dcd337403bdc7a39 Mon Sep 17 00:00:00 2001 From: Jan Kaiser Date: Tue, 28 Sep 2021 07:48:37 +0200 Subject: [PATCH] fix: added missing cleanup, if response socket is no longer writeable --- lib/application.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/application.js b/lib/application.js index f30045466..155ac8a2d 100644 --- a/lib/application.js +++ b/lib/application.js @@ -221,9 +221,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