Skip to content

Commit

Permalink
Only set cookie header if cookieString isn't empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahaj authored Dec 19, 2023
1 parent 640b5f6 commit b35a6d0
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 b35a6d0

Please sign in to comment.