nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.24k stars 514 forks source link

response with mutiple set-cookies using proxyRequest and routeRules #1220

Open j4tmr opened 1 year ago

j4tmr commented 1 year ago

Environment


Reproduction

git clone https://github.com/jhd4tmr/nitro-proxy.git
cd projectA
npm run dev
cd ../projectB
npm run dev

Then post http://localhost:3000/api/test. There will be two set-cookies key=v and key2=v Then post http://localhost:3001/api/test. There will be only one set-cookie key2=v

Describe the bug

When the response contains multiple set-cookies, only the last set-cookie can be obtained by using routeRules or proxyRequest, etc. When the node version is 18.16.0, it is true that only the last set-cookie can be obtained. I also tried other node versions, 17.3.0 and 18.13.0 are fine.

Additional context

No response

Logs

No response

j4tmr commented 1 year ago

Now updated to reproduce