Describe the bug
Node.js version: 16, but reproduced with 20 and 24 too.
OS version: Ubuntu 24.04
Description: cookie names are converted to lower case.
Actual behavior
Given an app which sets a cookie Foo=bar:
app.get('/v1/myroute', (req, res) => {
// Set a cookie with a mixed-case name
res.cookie('Foo', 'bar');
res.json({ message: 'Cookie set' });
});
When I write a test to expect the cookie Foo:
const res = await request(app)
.get('/v1/myroute/')
.set('Accept', 'application/json')
.expect(200)
.expect(cookies.new({name: 'Foo', value: 'bar'}));
And I run npm test:
Error: expected: Foo cookie to be set
Then the test fails.
Expected behavior
The test passes.
Code to reproduce
See this code reproducer: https://github.com/caarmen/supertest-cookie-issue/tree/main
And a failing test PR: #880
Checklist
Describe the bug
Node.js version: 16, but reproduced with 20 and 24 too.
OS version: Ubuntu 24.04
Description: cookie names are converted to lower case.
Actual behavior
Given an app which sets a cookie
Foo=bar:When I write a test to expect the cookie
Foo:And I run
npm test:Then the test fails.
Expected behavior
The test passes.
Code to reproduce
See this code reproducer: https://github.com/caarmen/supertest-cookie-issue/tree/main
And a failing test PR: #880
Checklist