Skip to content

Commit 7cafcd7

Browse files
committed
cleanup
1 parent 9270d3d commit 7cafcd7

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

packages/tracing-internal/src/browser/request.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ export interface XHRData {
9090
endTimestamp?: number;
9191
}
9292

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+
93104
export const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {
94105
traceFetch: true,
95106
traceXHR: true,
@@ -210,17 +221,9 @@ export function fetchCallback(
210221
}
211222
}
212223

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+
*/
224227
export function addTracingHeadersToFetchRequest(
225228
request: string | Request,
226229
dynamicSamplingContext: Partial<DynamicSamplingContext>,

0 commit comments

Comments
 (0)