-
-
Notifications
You must be signed in to change notification settings - Fork 663
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
If the dispatcher contains an interceptor, even a dummy one, the Set-Cookie
headers will be concatenated together.
Reproducible By
const http = require('node:http')
const {Agent} = require('undici');
const dispatcher = new Agent().compose((dispatch) => dispatch)
const server = http.createServer((req, res) => {
res.writeHead(200, [['set-cookie', 'a=1'], ['set-cookie', 'b=2'], ['set-cookie', 'c=3']])
res.end("ok")
})
server.listen({port: 3002}, () => {
Promise.all([fetch('http://localhost:3002'), fetch('http://localhost:3002', {dispatcher})])
.then(([r1, r2]) => {
console.log(r1.headers.getSetCookie())
console.log(r2.headers.getSetCookie())
})
.then(() => server.close())
});
The output will be:
[ 'a=1', 'b=2', 'c=3' ]
[ 'a=1,b=2,c=3' ]
Expected Behavior
The two outputs should be identical.
Environment
Nodejs 24.4.1
Undici 7.13.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working