-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update the node.js version range #648
base: main
Are you sure you want to change the base?
Conversation
@@ -93,7 +93,7 @@ | |||
"author": "Artem Zakharchenko", | |||
"license": "MIT", | |||
"engines": { | |||
"node": ">=18" | |||
"node": ">=18.20.0 <20 || >=20.12.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why skipping v21?
Also, could you give more context why we need to update the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the rawHeaders
symbol change in Node.js.
Why skipping v21?
What do you mean?
This range translates to: "any version between 18.20.0 and 20, OR anything above 20.12.1"
You can play this it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a bit confused. We currently don't depend on Node.js for raw headers and use our own proxy to gather them. Does the version change still apply in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting..
const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest')
const http = require('http')
const interceptor = new ClientRequestInterceptor({
name: 'my-interceptor',
})
interceptor.apply();
interceptor.on('request', async ({ controller }) => {
controller.respondWith(new Response(null, { headers: { 'set-cookie': ['mocked-cookie-0;mocked-cookie-1', 'mocked-cookie-2'] }}))
});
(async function () {
http.get('http://example.com', (res) => {
console.log(res.headers);
});
})()
With version 20.11.1 the output is: (Array length is 1)
{ 'set-cookie': [ 'mocked-cookie-0;mocked-cookie-1,mocked-cookie-2' ] }
With version 20.12.2 the output is: (Array length is 2, as expected)
{ 'set-cookie': [ 'mocked-cookie-0;mocked-cookie-1', 'mocked-cookie-2' ] }
Following this: #598 (comment)