7351 Commits
Author SHA1 Message Date
Matteo Collina 2d1eefad98 http: add regression test for smuggling content length
PR-URL: https://github.com/nodejs-private/node-private/pull/284
Reviewed-By: Akshay K <iit.akshay@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-10-11 16:37:20 +01:00
Matteo Collina 45d419ab1c http: add regression test for chunked smuggling
PR-URL: https://github.com/nodejs-private/node-private/pull/284
Reviewed-By: Akshay K <iit.akshay@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-10-11 16:37:20 +01:00
Antoine du Hamel c7f3294d02 fs: add stream utilities to FileHandle
PR-URL: https://github.com/nodejs/node/pull/40009
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: https://github.com/nodejs/node/pull/40329
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2021-10-06 22:27:39 -04:00
cjihrig f4164fa4c3 util: expose stripVTControlCharacters()
This commit exposes the existing stripVTControlCharacters()
method with docs and some additional input validation.

PR-URL: https://github.com/nodejs/node/pull/40214
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-10-04 20:32:17 +02:00
Matteo Collina 555af5b808 http: remove 'data' and 'end' listener if client parser error
There might be the case of some more data coming through after
the parser has returned an error and we have destroyed the socket.
We should also be removing the 'data' event handler.

Fixes: https://github.com/nodejs/node/issues/40242

PR-URL: https://github.com/nodejs/node/pull/40244
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-10-04 20:32:16 +02:00
Mestery 344c03b2e6 repl: skip EmptyStatements and return result with TLA
Fixes: https://github.com/nodejs/node/issues/39932

PR-URL: https://github.com/nodejs/node/pull/40194
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-10-04 20:31:51 +02:00
Artur K 22725f5bdd http: use 0 as default for requests limit
PR-URL: https://github.com/nodejs/node/pull/40192
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2021-10-04 20:31:29 +02:00
thunder-coding 685c7d43a5 deps: update nghttp2 to v1.45.1
PR-URL: https://github.com/nodejs/node/pull/40206
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2021-10-04 20:31:28 +02:00
MrBBot 88e7bd073a events: allow dispatch many times without listener
Fast path for EventTarget dispatch with no listeners didn't reset
kIsBeingDispatched flag, meaning same event couldn't be dispatched
multiple times.

PR-URL: https://github.com/nodejs/node/pull/39772
Refs: https://github.com/nodejs/node/pull/39395
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-10-04 20:31:28 +02:00
Michaël Zasso 6be405bd7b test: fix test-dgram-udp6-link-local-address on Windows
PR-URL: https://github.com/nodejs/node/pull/40005
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-09-22 00:27:15 +01:00
Filip Skokan f0dec58d43 crypto: fix webcrypto ed(25519|448) spki/pkcs8 import
PR-URL: https://github.com/nodejs/node/pull/40131
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-09-22 00:27:15 +01:00
Artur K a63a4bce90 http: limit requests per connection
Fixes: https://github.com/nodejs/node/issues/40071
PR-URL: https://github.com/nodejs/node/pull/40082
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-09-22 00:27:14 +01:00
Antoine du Hamel ec94bec9a3 test: do not run test-corepack-yarn-install with no internet
PR-URL: https://github.com/nodejs/node/pull/40090
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-09-22 00:27:13 +01:00
Daniel Bevenius 4aa2610252 test: update OpenSSL3 error messages for 3.0.0+quic
This commit updates two OpenSSL 3.0.0 error messages required for
OpenSSL 3.0.0+quic.

PR-URL: https://github.com/nodejs/node/pull/40093
Refs: https://github.com/nodejs/build/pull/2759
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-22 00:26:58 +01:00
Santiago Gimeno 5983568204 worker: avoid potential deadlock on NearHeapLimit
It can happen that the `NearHeapLimit` callback is called while calling
the `oninit()` function on `MessagePort` construction causing a deadlock
when the `Worker::Exit()` method is called, as the `mutex_` was already
held on the `CreateEnvMessagePort()` method. To fix it, just use the
`mutex_` to protect the `child_port_data_` variable and avoid holding it
when creating the `MessagePort`.
Also, return early from `Worker::Run()` if the worker message port
could not be created.

Fixes: https://github.com/nodejs/node/issues/38208

PR-URL: https://github.com/nodejs/node/pull/38403
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2021-09-22 00:26:55 +01:00
Dominic Elm 9f3a015b60 src: add option to disable loading native addons
PR-URL: https://github.com/nodejs/node/pull/39977
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-09-22 00:26:22 +01:00
Tobias Nießen d657ae6f8a crypto: fix RSA-PSS default saltLength
PR-URL: https://github.com/nodejs/node/pull/39999
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-09-21 19:14:08 +01:00
Tobias Nießen fc45cbe7a8 crypto: fix default MGF1 hash for OpenSSL 3
Refs: https://github.com/nodejs/node/pull/39999

PR-URL: https://github.com/nodejs/node/pull/40031
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-09-21 19:14:08 +01:00
Mestery d6124d8259 repl: fix top level await with surrogate characters
Fixes: https://github.com/nodejs/node/issues/39929

PR-URL: https://github.com/nodejs/node/pull/39931
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2021-09-21 19:13:39 +01:00
Filip Skokan 105c9e6d3b crypto: check webcrypto asymmetric key types during importKey
PR-URL: https://github.com/nodejs/node/pull/39962
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-21 19:13:37 +01:00
Michaël Zasso 67bbfeb7e1 test: make tests pass on Windows with Unix EOL
It is possible on Windows to configure Git to checkout line-endings
"as-is", which for Node.js means Unix-style.
This change makes the tests that rely on line endings pass in that case.

PR-URL: https://github.com/nodejs/node/pull/40002
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-21 19:13:36 +01:00
XadillaX 640353af86 lib,repl: ignore non-canBeRequiredByUsers built-in
e.g. `wasi` under no `--experimental-wasi-unstable-preview1` flag
shouldn't be pre-required.

PR-URL: https://github.com/nodejs/node/pull/39942
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-21 19:13:35 +01:00
Filip Skokan fb226ff2ee crypto: add rsa-pss keygen parameters
PR-URL: https://github.com/nodejs/node/pull/39927
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-10 20:34:38 +01:00
Robert Nagy 97f3072ceb stream: add signal support to pipeline generators
Generators in pipeline must be able to be aborted or pipeline
can deadlock.

PR-URL: https://github.com/nodejs/node/pull/39067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-10 20:34:38 +01:00
Robert Nagy cb44781371 stream: add stream.compose
Refs: #32020

PR-URL: https://github.com/nodejs/node/pull/39029
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/39563
2021-09-06 09:23:53 +02:00
Tobias Nießen 585199497f crypto: fix regression in RSA-PSS keygen
Fixes: https://github.com/nodejs/node/issues/39936
Refs: https://github.com/nodejs/node/pull/35093

PR-URL: https://github.com/nodejs/node/pull/39937
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-06 09:19:24 +02:00
Michaël Zasso ca9b781d20 test: use assert.match instead of regexp.test
PR-URL: https://github.com/nodejs/node/pull/39928
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-06 09:19:23 +02:00
Antoine du Hamel 112af69194 fs: add docs and tests for AsyncIterable support in fh.writeFile
Refs: https://github.com/nodejs/node/pull/37490

PR-URL: https://github.com/nodejs/node/pull/39836
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
2021-09-06 09:19:21 +02:00
Tobias Nießen 34c627e4bc crypto: add RSA-PSS params to asymmetricKeyDetails
Fixes: https://github.com/nodejs/node/issues/39837
Refs: https://github.com/openssl/openssl/pull/10568

PR-URL: https://github.com/nodejs/node/pull/39851
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-09-06 09:19:21 +02:00
Darshan Sen 007e2855af test: use error code mapping in place of raw errno
Refs: https://github.com/nodejs/node/pull/38159#discussion_r610288214

PR-URL: https://github.com/nodejs/node/pull/38675
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-09-06 09:19:21 +02:00
Filip Skokan 1dd91582da crypto: fix rsa-pss one-shot sign/verify error handling
fixes #39822

PR-URL: https://github.com/nodejs/node/pull/39830
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-06 09:19:20 +02:00
Qingyu Deng 00529b0ef2 test: add test to verify other extension can be loaded by worker
PR-URL: https://github.com/nodejs/node/pull/39788
Fixes: https://github.com/nodejs/node/issues/39124
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-09-06 09:19:20 +02:00
Qingyu Deng 16271d2f50 worker: remove file extension check
Fixes: https://github.com/nodejs/node/issues/39124

PR-URL: https://github.com/nodejs/node/pull/39788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-09-06 09:19:20 +02:00
leeight 4e7212c88c test: update error message keywords
This testcase failed on Apple Silicon M1, add the error message pattern:
`not a mach-o file`

PR-URL: https://github.com/nodejs/node/pull/39826
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2021-09-06 09:19:16 +02:00
Filip Skokan 20cf47004e crypto: fix JWK RSA-PSS SubtleCrypto.exportKey
PR-URL: https://github.com/nodejs/node/pull/39828
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-06 08:40:02 +02:00
James M Snell cfbe9065ae events: add brand checks for detached accessors
PR-URL: https://github.com/nodejs/node/pull/39773
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-06 08:40:01 +02:00
James M Snell 3b1ce93e03 worker: add brand checks for detached MessageEvent accessors
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39773
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-06 08:40:01 +02:00
Maël Nison 71659fd4ba deps: add corepack
Corepack provides shims for Yarn and pnpm in order to soften the
developer experience when working on Node projects.

Refs: https://github.com/nodejs/node/issues/15244
Refs: https://github.com/nodejs/TSC/issues/904

PR-URL: https://github.com/nodejs/node/pull/39608
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-06 08:40:01 +02:00
Michaël Zasso 549d717722 test: adapt test-fs-read to V8 9.3
An error message changed.

Refs: https://github.com/v8/v8/commit/c0fd89c3c089e888c4f4e8582e56db7066fa779b

PR-URL: https://github.com/nodejs/node/pull/39469
Backport-PR-URL: https://github.com/nodejs/node/pull/39947
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-01 18:10:20 +02:00
Michaël Zasso 644b25e068 test: adapt test-util-inspect to V8 9.3
Classes' "name" property is now installed between "length" and
"prototype".

Refs: https://github.com/v8/v8/commit/224b659cd40b6e11c71262b8a938c0c66cd9bba6

PR-URL: https://github.com/nodejs/node/pull/39469
Backport-PR-URL: https://github.com/nodejs/node/pull/39947
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-01 18:10:19 +02:00
Michaël Zasso 105bff9ea5 test: adapt test-v8-flags to V8 9.3
%_IsSmi was removed. %IsSmi can be used instead.

Refs: https://github.com/v8/v8/commit/863a2d6c244be84b54b4903711d86c349b3c0767

PR-URL: https://github.com/nodejs/node/pull/39469
Backport-PR-URL: https://github.com/nodejs/node/pull/39947
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-01 18:10:19 +02:00
Robert Nagy a6d50a18a0 stream: duplexify
PR-URL: https://github.com/nodejs/node/pull/39519
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <ckbenjamingr@gmail.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/39820
2021-08-23 15:41:25 +02:00
Robert Nagy af7047a815 stream: add isDisturbed helper
Adds a helper util used to determine whether a stream has been
disturbed (read or cancelled).

Refs: https://github.com/nodejs/node/issues/39627

PR-URL: https://github.com/nodejs/node/pull/39628
Backport-PR-URL: https://github.com/nodejs/node/pull/39819
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-08-23 13:22:14 +02:00
Robert Nagy 66400374de util: expose toUSVString
Expose toUSVString so it can be used by user libraries.

PR-URL: https://github.com/nodejs/node/pull/39814
Refs: https://github.com/nodejs/undici/pull/986
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-08-22 08:48:42 +02:00
8fa38500f2 policy: canonicalize before resolving specifiers
PR-URL: https://github.com/nodejs/node/pull/37863
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>

Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-08-22 08:48:28 +02:00
Don Jayamanne a7a217be13 repl: fix tla function hoisting
PR-URL: https://github.com/nodejs/node/pull/39745
Fixes: https://github.com/nodejs/node/issues/39744
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-08-22 08:48:27 +02:00
James M Snell dcab88ad38 worker: add brand checks for detached properties/methods
Add proper brand-checking for detached property and method
accesses. Also adds a note about non-standard APIs and
makes the standard accessors enumerable.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39763
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-08-16 16:35:27 -04:00
Tobias Nießen 7ff21397d6 policy: fix integrity when DEFAULT_ENCODING is set
PR-URL: https://github.com/nodejs/node/pull/39750
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-08-16 16:35:27 -04:00
voltrexmaster a5ded4a85a test: use simplfied validator
The validators test should use the simplified `validateArray()`
validator.

PR-URL: https://github.com/nodejs/node/pull/39753
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-08-16 16:35:26 -04:00
James M Snell 5bc31ea0aa buffer: add endings option, remove Node.js specific encoding option
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39708
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-08-16 16:35:26 -04:00