unjs / nitro

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

Inconsistent Node.js behavior for handling `set-cookie` headers #1462

Open pi0 opened 1 year ago

pi0 commented 1 year ago

Discovered while adding tests in https://github.com/unjs/nitro/pull/1452

Hebilicious commented 1 year ago

Given that Node < 18 reach EOL in a 3 months` should we consider moving everything to node 20 ? 🤔 https://endoflife.date/nodejs

pi0 commented 1 year ago

Good point. Still we support both. Maybe we can reduce amount of parsing workaround in favor of Node 20 :)

Hebilicious commented 1 year ago

Good point. Still we support both. Maybe we can reduce amount of parsing workaround in favor of Node 20 :)

Vite 5 is moving to drop support for node < 18 as well, so I think it makes sense that we align and support 18 and 20+, which (would fix this issue too :D)

I would like to move to 20+ though 😓 But it's probably too soon.

pi0 commented 1 year ago

Surely there is no blocker for Nuxt ecosystem at least. We preannounced rolling major versions for v3 (https://nuxt.com/blog/v3#the-browser-and-nodejs-support)

Only for nitro, i think i will aim for next major version to drop node 16,18.

BTW regarding this issue: Node 20 also needs fix for normalization.

jeanpierrecarvalho commented 11 months ago

@pi0 @Hebilicious Given that Node.js versions 17 and 19 have reached their end of life (EOL), I propose adjusting the Node.js version requirement to only accept versions >=18.16, while explicitly excluding version 19, and also including support for version 20. This adjustment would align with the EOL status of previous versions and ensure a more robust and forward-looking compatibility. What are your thoughts on this?

pi0 commented 11 months ago

@jeanpierrecarvalho As explained above, it is not that easy decision to make to immediately drop older EOL versions of Node.js we have a vast ecosystem and users.

Also even if we drop older Node.js versions at some point, runtime behavior of recent Node.js (incl 20) is not consistent and does not automatically split cookies.

Hebilicious commented 11 months ago

@pi0 Do we have access to the telemetry stats regarding the node versions that nitro/nuxt / nitro preset users are using ? Having some insight would be helpful in making these type of decisions.