Skip to content

Doesn't work with bun, no cookies emitted or captured #692

@Thinkscape

Description

@Thinkscape

Describe the bug

When run with bun as runtime, doesn't seem to include nor parse cookies.
Tested with global fetch and axios.

To Reproduce

Steps to reproduce the behavior:

  1. Run the examples from this repo or https://github.com/3846masa/axios-cookiejar-support
  2. Send a request which responds with set-cookie headers.
  3. Send another request

Expected behavior

The cookie jar has cookies. The second request sends them back

Actual behaviour

Cookie jar is empty.
Second request has no cookie header.

Setting cookies manually with jar.setCookieSync(...) between requests, then sending second request still results in second request not containing cookie header 🤔

Repro

const jar = new CookieJar(undefined, {
// -- Tried all of those, didn't help
//  looseMode: true,
//  prefixSecurity: "unsafe-disabled",
//  rejectPublicSuffixes: false,
//  allowSpecialUseDomain: true,
});
const client = wrapper(axios.create({jar }));

await client.get('https://some.site');
console.log(jar.toJSON());
bun run example.ts

Environments

  • OS: macos
  • Bun version: 1.0.12
  • axios version: 1.6.1
  • tough-cookie version: 4.1.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions