Skip to content

Commit c7c9276

Browse files
committed
more adjustments
1 parent 27799ca commit c7c9276

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/node/src/integrations/http/SentryHttpInstrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
153153

154154
return (
155155
original: (event: string, ...args: unknown[]) => boolean,
156-
): ((this: unknown, ...args: [event: string, ...args: unknown[]]) => boolean) => {
156+
): ((this: unknown, event: string, ...args: unknown[]) => boolean) => {
157157
return function incomingRequest(this: unknown, ...args: [event: string, ...args: unknown[]]): boolean {
158158
// Only traces request events
159159
if (args[0] !== 'request') {

packages/node/src/integrations/http/SentryHttpInstrumentationBeforeOtel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ export class SentryHttpInstrumentationBeforeOtel extends InstrumentationBase {
5151
return (
5252
original: (event: string, ...args: unknown[]) => boolean,
5353
): ((this: unknown, event: string, ...args: unknown[]) => boolean) => {
54-
return function incomingRequest(this: unknown, event: string, ...args: unknown[]): boolean {
54+
return function incomingRequest(this: unknown, ...args: [event: string, ...args: unknown[]]): boolean {
5555
// Only traces request events
56-
if (event !== 'request') {
57-
return original.apply(this, [event, ...args]);
56+
if (args[0] !== 'request') {
57+
return original.apply(this, args);
5858
}
5959

6060
const response = args[1] as http.OutgoingMessage;
6161

6262
patchResponseToFlushOnServerlessPlatforms(response);
6363

64-
return original.apply(this, [event, ...args]);
64+
return original.apply(this, args);
6565
};
6666
};
6767
}

0 commit comments

Comments
 (0)