don't execute APIs where a plugin disconnected the socket, as we can assume it's meant to stop
Massimo Melina committed
Sep 15, 2025 at 11:04 UTC
4b06eb7f73f2be088051a739bfb33de04ba977df
1 file changed
+2
src/plugins.ts
+2
@@ -192,6 +192,8 @@ export const pluginsMiddleware: Koa.Middleware = async (ctx, next) => {
192
lastStatus = ctx.status
193
lastBody = ctx.body
194
}
195
+ if (ctx.isAborted())
196
+ ctx.stop()
197
if (res === true && !ctx.isStopped) { //legacy pre-0.53
198
ctx.stop()
199
warnOnce(`plugin ${id} is using deprecated API (return true on middleware) and may not work with future versions (check for an update to "${id}")`)