Skip to content

Commit 80ecf6b

Browse files
committed
fix fetch order
1 parent 57bfd0e commit 80ecf6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/fetch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function instrumentFetchRequest(
8181
if (shouldAttachHeaders(handlerData.fetchData.url)) {
8282
const request: string | Request = handlerData.args[0];
8383

84-
const options: { [key: string]: unknown } = (handlerData.args[1] = handlerData.args[1] || {});
84+
const options: { [key: string]: unknown } = handlerData.args[1] || {};
8585

8686
const headers = _addTracingHeadersToFetchRequest(
8787
request,
@@ -92,6 +92,8 @@ export function instrumentFetchRequest(
9292
hasTracingEnabled() && hasParent ? span : undefined,
9393
);
9494
if (headers) {
95+
// Ensure this is actually set, if no options have been passed previously
96+
handlerData.args[1] = options;
9597
options.headers = headers;
9698
}
9799
}

0 commit comments

Comments
 (0)