File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/apm/src/integrations Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 99- [ tracing] feat: Pick up sentry-trace in JS <meta /> tag (#2703 )
1010- [ tracing] fix: Respect sample decision when continuing trace from header in node (#2703 )
1111- [ gatsby] fix: Package gatsby files properly (#2711 )
12+ - [ tracing] fix: All options of adding fetch headers (#2712 )
1213
1314## 5.18.1
1415
Original file line number Diff line number Diff line change @@ -1021,13 +1021,12 @@ function fetchCallback(handlerData: { [key: string]: any }): void {
10211021 if ( span ) {
10221022 const options = ( handlerData . args [ 1 ] = ( handlerData . args [ 1 ] as { [ key : string ] : any } ) || { } ) ;
10231023 if ( options . headers ) {
1024- if ( Array . isArray ( options . headers ) ) {
1025- options . headers = [ ...options . headers , { 'sentry-trace' : span . toTraceparent ( ) } ] ;
1024+ if ( typeof options . headers . append === 'function' ) {
1025+ options . headers . append ( 'sentry-trace' , span . toTraceparent ( ) ) ;
1026+ } else if ( Array . isArray ( options . headers ) ) {
1027+ options . headers = [ ...options . headers , [ 'sentry-trace' , span . toTraceparent ( ) ] ] ;
10261028 } else {
1027- options . headers = {
1028- ...options . headers ,
1029- 'sentry-trace' : span . toTraceparent ( ) ,
1030- } ;
1029+ options . headers = { ...options . headers , 'sentry-trace' : span . toTraceparent ( ) } ;
10311030 }
10321031 } else {
10331032 options . headers = { 'sentry-trace' : span . toTraceparent ( ) } ;
You can’t perform that action at this time.
0 commit comments