@@ -90,6 +90,17 @@ export interface XHRData {
90
90
endTimestamp ?: number ;
91
91
}
92
92
93
+ type PolymorphicRequestHeaders =
94
+ | Record < string , string | undefined >
95
+ | Array < [ string , string ] >
96
+ // the below is not preicsely the Header type used in Request, but it'll pass duck-typing
97
+ | {
98
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
+ [ key : string ] : any ;
100
+ append : ( key : string , value : string ) => void ;
101
+ get : ( key : string ) => string ;
102
+ } ;
103
+
93
104
export const defaultRequestInstrumentationOptions : RequestInstrumentationOptions = {
94
105
traceFetch : true ,
95
106
traceXHR : true ,
@@ -210,17 +221,9 @@ export function fetchCallback(
210
221
}
211
222
}
212
223
213
- type PolymorphicRequestHeaders =
214
- | Record < string , string | undefined >
215
- | Array < [ string , string ] >
216
- // the below is not preicsely the Header type used in Request, but it'll pass duck-typing
217
- | {
218
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
- [ key : string ] : any ;
220
- append : ( key : string , value : string ) => void ;
221
- get : ( key : string ) => string ;
222
- } ;
223
-
224
+ /**
225
+ * Adds sentry-trace and baggage headers to the various forms of fetch headers
226
+ */
224
227
export function addTracingHeadersToFetchRequest (
225
228
request : string | Request ,
226
229
dynamicSamplingContext : Partial < DynamicSamplingContext > ,
0 commit comments