Skip to content

Commit

Permalink
Merge pull request #17 from rosahaj/patch-1
Browse files Browse the repository at this point in the history
Only set cookie header if cookieString isn't empty
  • Loading branch information
jd1378 authored Dec 19, 2023
2 parents 640b5f6 + b35a6d0 commit 0f68382
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export function wrapFetch(options?: WrapFetchOptions): typeof fetch {
});
}

reqHeaders.set("cookie", cookieString);
if (cookieString.length) {
reqHeaders.set("cookie", cookieString);
}

reqHeaders.delete("cookie2"); // Remove cookie2 if it exists, It's deprecated

interceptedInit.headers = reqHeaders;
Expand Down

0 comments on commit 0f68382

Please sign in to comment.