From 2d7b3ed44070aa143947b1aa050e5136956f1501 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sun, 10 Oct 2021 23:52:51 +0000 Subject: [PATCH] requestStart: Fix so requestEnded gets called with ctx --- flaska.mjs | 2 +- test/flaska.in.test.mjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flaska.mjs b/flaska.mjs index 3e8731a..eeb3b25 100644 --- a/flaska.mjs +++ b/flaska.mjs @@ -403,7 +403,7 @@ export class Flaska { ctx.aborted = true }) req.on('close', () => { - this.requestEnded() + this.requestEnded(ctx) }) try { diff --git a/test/flaska.in.test.mjs b/test/flaska.in.test.mjs index bb78c15..73534b1 100644 --- a/test/flaska.in.test.mjs +++ b/test/flaska.in.test.mjs @@ -51,6 +51,7 @@ t.describe('#requestStart()', function() { assert.strictEqual(onEnded.called, false) assertReq.on.thirdCall[1]() assert.strictEqual(onEnded.called, true) + assert.strictEqual(onEnded.firstCall[0], ctx) // Test abort and close