Bug Description
[RFC9113], Section 8.2.3
The Cookie header field [COOKIE] uses a semicolon (";") to delimit cookie-pairs (or "crumbs").
Currently the implementation has no special case for the cookie header and uses commas (",") as delimiter.
Using semicolon as delimiter should be an easy fix, otoh the linked RFC section continues:
To allow for better compression efficiency, the Cookie header field MAY be split into separate header fields, each with one or more cookie-pairs.
So maybe instead of
undici should send
cookie: a=b
cookie: c=d
cookie: e=f
🤔
Reproducible By
import http2 from "node:http2";
import { H2CClient } from "undici";
const port = process.env.PORT ?? 3001;
http2
.createServer((req, res) => {
console.log(req.headers);
res.end();
})
.listen(port, async () => {
const headers = { cookie: ["a=b", "c=d", "e=f"] };
const client = new H2CClient(`http://localhost:${port}`);
await client.request({ path: "/", method: "GET", headers });
});
[Object: null prototype] {
':authority': 'localhost:3001',
':method': 'GET',
':path': '/',
':scheme': 'https',
cookie: 'a=b, c=d, e=f',
Symbol(sensitiveHeaders): [ 'cookie' ]
}
Bug Description
[RFC9113], Section 8.2.3
Currently the implementation has no special case for the
cookieheader and uses commas (",") as delimiter.Using semicolon as delimiter should be an easy fix, otoh the linked RFC section continues:
So maybe instead of
undici should send
🤔
Reproducible By