File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/apm/src/integrations Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1021,13 +1021,12 @@ function fetchCallback(handlerData: { [key: string]: any }): void {
1021
1021
if ( span ) {
1022
1022
const options = ( handlerData . args [ 1 ] = ( handlerData . args [ 1 ] as { [ key : string ] : any } ) || { } ) ;
1023
1023
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 ( ) ] ] ;
1026
1028
} else {
1027
- options . headers = {
1028
- ...options . headers ,
1029
- 'sentry-trace' : span . toTraceparent ( ) ,
1030
- } ;
1029
+ options . headers = { ...options . headers , 'sentry-trace' : span . toTraceparent ( ) } ;
1031
1030
}
1032
1031
} else {
1033
1032
options . headers = { 'sentry-trace' : span . toTraceparent ( ) } ;
You can’t perform that action at this time.
0 commit comments