@@ -175,8 +175,7 @@ export const instrumentHttp = Object.assign(
175
175
patchRequestToCaptureBody ( req , normalizedRequest ) ;
176
176
177
177
// Update the isolation scope, isolate this request
178
- isolationScope . setSDKProcessingMetadata ( { normalizedRequest } ) ;
179
- isolationScope . setSDKProcessingMetadata ( { request : req } ) ;
178
+ isolationScope . setSDKProcessingMetadata ( { request : req , normalizedRequest } ) ;
180
179
181
180
const client = getClient < NodeClient > ( ) ;
182
181
if ( client && client . getOptions ( ) . autoSessionTracking ) {
@@ -353,7 +352,7 @@ function patchRequestToCaptureBody(req: HTTPModuleRequestIncomingMessage, normal
353
352
// eslint-disable-next-line @typescript-eslint/unbound-method
354
353
req . on = new Proxy ( req . on , {
355
354
apply : ( target , thisArg , args : Parameters < typeof req . on > ) => {
356
- const [ event , listener ] = args ;
355
+ const [ event , listener , ... restArgs ] = args ;
357
356
358
357
if ( event === 'data' ) {
359
358
const callback = new Proxy ( listener , {
@@ -366,7 +365,7 @@ function patchRequestToCaptureBody(req: HTTPModuleRequestIncomingMessage, normal
366
365
367
366
callbackMap . set ( listener , callback ) ;
368
367
369
- return Reflect . apply ( target , thisArg , [ event , callback ] ) ;
368
+ return Reflect . apply ( target , thisArg , [ event , callback , ... restArgs ] ) ;
370
369
}
371
370
372
371
if ( event === 'end' ) {
@@ -389,7 +388,7 @@ function patchRequestToCaptureBody(req: HTTPModuleRequestIncomingMessage, normal
389
388
390
389
callbackMap . set ( listener , callback ) ;
391
390
392
- return Reflect . apply ( target , thisArg , [ event , callback ] ) ;
391
+ return Reflect . apply ( target , thisArg , [ event , callback , ... restArgs ] ) ;
393
392
}
394
393
395
394
return Reflect . apply ( target , thisArg , args ) ;
0 commit comments