Skip to content

Commit

Permalink
Merge branch 'main' of github.com:jd1378/deno-another-cookiejar
Browse files Browse the repository at this point in the history
  • Loading branch information
jd1378 committed Jul 20, 2024
2 parents a5a8c17 + 7c8ffa1 commit 5feaa82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Cookie,
CookieJar,
wrapFetch,
} from "https://deno.land/x/another_cookiejar@v5.0.3/mod.ts";
} from "https://deno.land/x/another_cookiejar@v5.0.4/mod.ts";
```

### wrapFetch
Expand Down
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 5feaa82

Please sign in to comment.