requestStart: Fix so requestEnded gets called with ctx

This commit is contained in:
Jonatan Nilsson 2021-10-10 23:52:51 +00:00
parent 3a48c88c3a
commit 2d7b3ed440
2 changed files with 2 additions and 1 deletions

View file

@ -403,7 +403,7 @@ export class Flaska {
ctx.aborted = true ctx.aborted = true
}) })
req.on('close', () => { req.on('close', () => {
this.requestEnded() this.requestEnded(ctx)
}) })
try { try {

View file

@ -51,6 +51,7 @@ t.describe('#requestStart()', function() {
assert.strictEqual(onEnded.called, false) assert.strictEqual(onEnded.called, false)
assertReq.on.thirdCall[1]() assertReq.on.thirdCall[1]()
assert.strictEqual(onEnded.called, true) assert.strictEqual(onEnded.called, true)
assert.strictEqual(onEnded.firstCall[0], ctx)
// Test abort and close // Test abort and close