File tree 1 file changed +9
-9
lines changed
packages/node/src/integrations
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -349,11 +349,7 @@ function patchRequestToCaptureBody(req: HTTPModuleRequestIncomingMessage, normal
349
349
const callback = new Proxy ( listener , {
350
350
apply : ( target , thisArg , args : Parameters < typeof listener > ) => {
351
351
const chunk = args [ 0 ] ;
352
- try {
353
- chunks . push ( chunk ) ;
354
- } catch {
355
- // ignore errors here...
356
- }
352
+ chunks . push ( chunk ) ;
357
353
return Reflect . apply ( target , thisArg , args ) ;
358
354
} ,
359
355
} ) ;
@@ -366,11 +362,15 @@ function patchRequestToCaptureBody(req: HTTPModuleRequestIncomingMessage, normal
366
362
if ( event === 'end' ) {
367
363
const callback = new Proxy ( listener , {
368
364
apply : ( target , thisArg , args ) => {
369
- const body = Buffer . concat ( chunks ) . toString ( 'utf-8' ) ;
365
+ try {
366
+ const body = Buffer . concat ( chunks ) . toString ( 'utf-8' ) ;
370
367
371
- // We mutate the passed in normalizedRequest and add the body to it
372
- if ( body ) {
373
- normalizedRequest . data = body ;
368
+ // We mutate the passed in normalizedRequest and add the body to it
369
+ if ( body ) {
370
+ normalizedRequest . data = body ;
371
+ }
372
+ } catch {
373
+ // ignore errors here
374
374
}
375
375
376
376
return Reflect . apply ( target , thisArg , args ) ;
You can’t perform that action at this time.
0 commit comments