Skip to content

Commit

Permalink
fix using Header object
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 committed Jun 25, 2024
1 parent e36b33b commit 37565b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/trace/interceptors/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ export default function windowFetch(options: CustomOptionsType, segments: Segmen
args[1] = {};
}
if (!args[1].headers) {
args[1].headers = {};
args[1].headers = new Headers();
}
if (args[1].headers instanceof Headers) {
args[1].headers.append('sw8', values);
} else {
args[1].headers['sw8'] = values;
}
args[1].headers['sw8'] = values;
}

const response = await originFetch(...args);
Expand Down

0 comments on commit 37565b0

Please sign in to comment.