Skip to content

Commit

Permalink
Update fetchInterceptor.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming committed Dec 22, 2024
1 parent 8524d9f commit 69a0f7e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/shared/src/request/fetchInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const newFetch = async function (
const isOneKeyDomain = await checkIsOneKeyDomain(url);
let requestId: string | undefined;
if (isOneKeyDomain) {
options.headers = options.headers || {};
const headers = await getRequestHeaders();
requestId = headers[HEADER_REQUEST_ID_KEY];
forEach(headers, (val, key) => {
Expand All @@ -71,11 +72,6 @@ const newFetch = async function (
headers[key] = val;
}
// @ts-ignore
if (!options.headers) {
// @ts-ignore
options.headers = {};
}
// @ts-ignore
options.headers[key] = val;
});
}
Expand Down

0 comments on commit 69a0f7e

Please sign in to comment.