Skip to content

Commit f264c37

Browse files
committed
Add downstreamAborted to passthrough-abort event data
1 parent d33efcd commit f264c37

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/rules/requests/request-handlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ export class PassThroughHandler extends PassThroughHandlerDefinition {
11221122
reportedUpstreamError = true;
11231123

11241124
options.emitEventCallback('passthrough-abort', {
1125+
downstreamAborted: !!(serverReq?.aborted),
11251126
error: {
11261127
name: e.name,
11271128
code: e.code,

test/integration/subscriptions/rule-events.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
nodeOnly
1616
} from "../../test-utils";
1717

18-
describe("Rule event susbcriptions", () => {
18+
describe("Rule event subscriptions", () => {
1919

2020
const server = getLocal();
2121
const remoteServer = getLocal();
@@ -257,6 +257,7 @@ describe("Rule event susbcriptions", () => {
257257
const responseAbortEvent = ruleEvents[2].eventData;
258258
expect(responseAbortEvent.error.name).to.equal('Error');
259259
expect(responseAbortEvent.error.message).to.equal('socket hang up');
260+
expect(responseAbortEvent.downstreamAborted).to.equal(false);
260261
});
261262

262263
nodeOnly(() => {
@@ -300,6 +301,7 @@ describe("Rule event susbcriptions", () => {
300301
expect(responseAbortEvent.error.name).to.equal('Error');
301302
expect(responseAbortEvent.error.code).to.equal('ECONNRESET');
302303
expect(responseAbortEvent.error.message).to.equal('aborted');
304+
expect(responseAbortEvent.downstreamAborted).to.equal(false);
303305
});
304306
});
305307

0 commit comments

Comments
 (0)