Commit Graph
8927 Commits
Author SHA1 Message Date
Archkon de6eeece8f zlib: validate pledgedSrcSize as a safe integer
pledgedSrcSize represents an exact byte count. Reject values that are
not non-negative safe integers instead of silently ignoring or coercing
them through IntegerValue().

Apply the same validation to zlib/iter and retain a native validation
check for internal callers.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64604
Fixes: https://github.com/nodejs/node/issues/64603
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Jan Martin <jan.krems@gmail.com>
2026-07-23 22:17:50 +00:00
Tim Perry f9715fc595 quic: defer server session emit until TLS ClientHello is processed
This ensures we don't fire session events for totally invalid TLS
handshakes - fundamental errors, bad SNI/ALPN values, or anything else
that our TLS config would reject. Instead, it means servers can access
servername & alpnProtocol synchronously as soon as the event is fired -
all key session data is available and it's immediately usable.

We don't want to defer further to handshake completed, since that'd be
an extra RT, and defeat 0RTT benefits entirely. ClientHello processed
without errors is sufficient for now.

This isn't a security mechanism. Existing structures will defer
actually sending & receiving anything that's not marked explicitly as
early data until the handshake completes anyway.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64132
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-23 13:44:46 +00:00
James M Snell 64c115072e stream, quic: update iterable streams backpressure
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
PR-URL: https://github.com/nodejs/node/pull/64464
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 05:19:45 -07:00
James M Snell b9ed467618 stream: update iterable streams to use budget backpressure
Updates the implementation to use the updated backpressure
model that landed here: https://github.com/WinterTC55/iter-streams/pull/23

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
PR-URL: https://github.com/nodejs/node/pull/64464
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 05:19:44 -07:00
Shivam S a609b172bd doc: fix dnsPromises.lookup verbatim default
The verbatim default flipped to true in v17 (#39987), but the
dnsPromises.lookup docs still say false. The order bullet right above
it and the dns.lookup section both already say the addresses are not
reordered by default, so this bullet was contradicting them.

Signed-off-by: BIGSUS24 <152616194+BIGSUS24@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64658
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 08:35:34 +00:00
Antoine du Hamel 2deb0a1b0f doc: fix broken links and clean up type map
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64625
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-22 13:18:57 +00:00
Ryuhei Shima cecfdceed3 zlib: accept ArrayBuffer dictionary in Zstd
Fixes: https://github.com/nodejs/node/issues/64598
Signed-off-by: islandryu <shimaryuhei@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64599
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-21 15:03:54 +00:00
Muhammad Zeeshan 4efa0c6311 doc: fix import.meta example for vm.SourceTextModule
The import.meta example for new vm.SourceTextModule() in vm.md does not
run as written. It fails in two separate ways.

First, the constructor is missing the context: contextifiedObject
option, so the module evaluates in the top context where secret is not
defined, and the snippet throws ReferenceError: secret is not defined.

Second, the trailing note suggests replacing meta.prop = {} with
vm.runInContext('{}', contextifiedObject), but '{}' is parsed as an
empty block and evaluates to undefined. That makes the following
Object.getPrototypeOf(import.meta.prop) throw TypeError. Wrapping it as
'({})' returns an object, which is what the note intends.

This adds the context option and corrects the suggested replacement to
'({})' in both the mjs and cjs variants.

Fixes: https://github.com/nodejs/node/issues/64076
Signed-off-by: Muhammad Zeeshan <61280174+zeeshan56656@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64112
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-21 07:33:45 +00:00
Steven f3ecafac44 doc: mention crypto.hash() for better perf
Signed-off-by: Steven <steven@ceriously.com>
PR-URL: https://github.com/nodejs/node/pull/63420
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-21 07:33:36 +00:00
Maxence Robinet 0bf185c566 doc: update sea example by fixing wrong code example
The SEA configuration defines the output binary as `sea`, but the
signing and run steps still referenced `hello`. Update the example
to use `sea` consistently so the commands match the generated
binary.

Signed-off-by: Maxence Robinet <107369283+saint-james-fr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64025
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-21 06:37:30 +00:00
YuSheng Chen 1b42f7600e doc: fix socket.readyState state descriptions
Signed-off-by: yusheng <samuel871211@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64468
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-20 21:51:40 +00:00
Filip Skokan 5b27fb976f doc: replace large tables in crypto.md and webcrypto.md with lists
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64582
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-20 18:25:05 +00:00
Paul Bouchon c286592321 doc: note --env-file is not applied to --run
Environment variables loaded with `--env-file` are not applied to the
command executed by `--run`. Document this limitation under `--run`.

Fixes: https://github.com/nodejs/node/issues/62988
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
PR-URL: https://github.com/nodejs/node/pull/64442
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-19 21:06:20 +00:00
Filip Skokan d90d9d55ad crypto: limit KangarooTwelveParams customization to 512 bytes
To align with a future OpenSSL-imposed limit.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64557
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-19 15:58:25 +00:00
avivkeller 4f844f4380 repl: use inspector over vm
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64034
Fixes: https://github.com/nodejs/node/issues/64523
Closes: https://github.com/nodejs/node/pull/64534
Fixes: https://github.com/nodejs/node/issues/39387
Closes: https://github.com/nodejs/node/pull/39392
Fixes: https://github.com/nodejs/node/issues/61390
Fixes: https://github.com/nodejs/node/issues/63126
Fixes: https://github.com/nodejs/node/issues/38503
Fixes: https://github.com/nodejs/node/issues/37445
Fixes: https://github.com/nodejs/node/issues/38145
Fixes: https://github.com/nodejs/node/issues/33369
Fixes: https://github.com/nodejs/node/issues/48131
Fixes: https://github.com/nodejs/node/issues/8309
Fixes: https://github.com/nodejs/node/issues/39689
Fixes: https://github.com/nodejs/node/issues/18931
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-07-18 12:59:37 -07:00
Matteo Collina fb5d01f2d1 http2: don't throw when destroying socket proxy
Calling destroy() on the http2session.socket proxy now destroys the
session instead of throwing ERR_HTTP2_NO_SOCKET_MANIPULATION.

Refs: https://github.com/nodejs/undici/issues/5525
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64427
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-18 12:27:51 +02:00
greenhead 3c88785f34 doc: fix typo in embedding.md
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64425
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-18 10:18:51 +00:00
Tim Perry ed2d7f4528 doc: document TLS alpnProtocol and servername fields
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64362
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-17 09:35:56 +00:00
Sebastian Beltran cc8594a9b1 quic: add support for TLS certificate compression
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64434
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-07-16 17:10:24 +00:00
Guy Bedford 39ed68cd7c net: support sync connect for BoundSocket
When a net.Socket is constructed from a net.BoundSocket, support
synchronous connect().

Signed-off-by: Guy Bedford <guybedford@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64375
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-16 00:56:40 +00:00
Harjoth Khara 5d68eb44ba doc: clarify PEM format for signing keys
Signed-off-by: harjoth <harjoth.khara@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64404
Fixes: https://github.com/nodejs/node/issues/35331
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-15 08:41:50 +00:00
Sebastian Beltran 7a11a9b2db tls: move _tls_* to end-of-life
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/60658
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-07-14 21:40:40 +00:00
Daijiro Wachi f7702431de doc: fix typo in tls.md
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64458
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
2026-07-14 16:52:12 +00:00
Jimmy Leung 3ac95f2d0c doc,test: widen fsPromises.appendFile()'s data type, add missing tests
From lib/internal/fs/promises.js, one can see fsPromises.appendFile() is
simply a wrapper on fsPromises.writeFile(). Hence if writeFile() can
take non-buffer data argument, so can appendFile() too.

To justify the doc change, I have also restuctured the relevant tests,
to enhance the test coverage. They now includes the below test cases
consistently.

- await do(Append|Write)Buffer();
- await do(Append|Write)BufferAndCancel();
- await do(Append|Write)String();
- await do(Append|Write)Stream();
- await do(Append|Write)StreamWithCancel();
- await do(Append|Write)Iterable();
- await do(Append|Write)InvalidIterable();
- await do(Append|Write)IterableWithEncoding();
- await do(Append|Write)BufferIterable();
- await do(Append|Write)AsyncIterable();
- await do(Append|Write)LargeIterable();
- await do(Append|Write)InvalidValues();
- await do(Append|Write)TypedArrays();

Note that test/parallel/test-fs-promises-writefile-typedarray.js is
subsumed by test/parallel/test-fs-promises-file-handle-writeFile.js, and
test/parallel/test-fs-promises-writefile-with-fd.js becomes a subcase in
test/parallel/test-fs-promises-file-handle-writeFile.js.

Refs: https://github.com/nodejs/node/pull/41677
Signed-off-by: Jimmy Leung <mingfamily@hotmail.com.hk>
PR-URL: https://github.com/nodejs/node/pull/64279
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-07-14 15:49:57 +00:00
Livia Medeirosandlouiellan 727e2bce8e lib,tools: add node-core/func-name-matching lint rule
And rename functions accordingly.

Signed-off-by: LiviaMedeiros <livia@cirno.name>
Co-authored-by: louiellan <louie.lou.llaneta@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/57901
Refs: https://github.com/nodejs/node/issues/57899
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-07-14 15:30:56 +02:00
Efe KarasakalandHerrtian e84b517d67 doc: document net Socket server property
Based on #63458.

Co-authored-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
Signed-off-by: Efe Karasakal <hi@efe.dev>
Signed-off-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64364
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-13 18:58:47 +00:00
Filip Skokan fc92e9119d doc: update a Dispatcher undici doc link
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64358
Refs: https://github.com/nodejs/undici-website/pull/7
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-13 17:01:04 +00:00
Joyee Cheung 8c6cbb8e0a inspector: add --cond to node inspect probe mode
On a hot path, the probe can record every hit and require
filtering afterwards. This patch adds a per-probe `--cond <expr>`
option that allows limiting the hit to only when the expression
is truthy at the probe location. V8 evaluates it as the breakpoint's
native condition, so the target is not paused when it does not hold,
and a condition that throws is treated as false. Since in CDP,
a location can only carry one breakpoint per URL pattern,
probes sharing a location must share one condition (or none).
Conflicting conditions are rejected.

Example:

```js
// app.js
let total = 0;
for (let i = 0; i < 10; i++) {
  total += i;  // line 4
}
```

```
$ out/Release/node inspect --probe app.js:4 --expr 'total' \
                           --cond 'i % 3 === 0' app.js
```

```
Hit 1 at file:///path/to/app.js:3:3
  total = 0
Hit 2 at file:///path/to/app.js:3:3
  total = 3
Hit 3 at file:///path/to/app.js:3:3
  total = 15
Hit 4 at file:///path/to/app.js:3:3
  total = 36
Completed
```

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64328
Refs: https://github.com/nodejs/node/issues/63646
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-13 17:00:51 +00:00
Jungwon Sohn 1314579f8c doc: fix typos in documentation
Fix typographical errors in API, contributor, and crypto docs.

Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64466
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2026-07-13 12:34:05 +02:00
Matteo Collina 47b6ef28e6 net: make TCP Server and Socket transferable across worker threads
Allow a listening net.Server or an accepted net.Socket to be moved to
another thread by listing it in the transferList of a worker_threads
postMessage() call. Unix only; Windows throws.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64225
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-07-12 15:11:28 +00:00
Moshe Atlow 892976d17a test_runner: add context.log() and test:log event
Add a log(message[, data]) method to TestContext and SuiteContext that
emits a new test:log event. Unlike test:diagnostic, which is buffered
so it is emitted in the order tests are defined, test:log is emitted
immediately, in the order tests execute, including under process
isolation where it bypasses the per-file declaration order buffer.
This gives reporters that render the test tree unbuffered a live,
attributed logging channel that captured stdout cannot provide under
concurrency.

The event carries the message, an optional opaque structured payload
that the runner passes through untouched, and the emitting test's
name, testId, parentId, nesting, and location. Built-in reporters
render it the same way they render test:diagnostic.

Signed-off-by: Moses Atlow <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/64389
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-07-12 11:45:05 +00:00
Archkon 794d9b1df0 doc: remove duplicate VirtualProvider description
Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64400
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-12 07:13:19 +00:00
Archkon 7c53fb51dc src: fix some typo errors and rename some variables
Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64301
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-07-12 06:16:34 +00:00
Moshe Atlow 8f5fda2d23 doc: add scope overview tables for TestsStream events
Summarize all TestsStream events in three tables by scope (test, file,
and global), pairing declaration ordered (buffered) test scoped events
with their execution ordered (immediate) equivalents.

Signed-off-by: Moshe Atlow <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/64386
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-07-11 08:11:37 +00:00
Matteo Collina 26079c0cfa doc: clarify proxy threat model
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64366
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-07-10 16:53:10 +00:00
Paolo Insogna 3e8aa7de27 ffi: add getCurrentEventLoop
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Assisted-By: OpenAI:GPT-5.5 <openai/gpt-5.5>
PR-URL: https://github.com/nodejs/node/pull/64323
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2026-07-08 13:24:50 +00:00
Node.js GitHub Bot 9051e5e7eb 2026-07-08, Version 26.5.0 (Current)
Notable changes:

buffer:
  * (SEMVER-MINOR) implement blob.textStream() (Matthew Aitken) https://github.com/nodejs/node/pull/64036
esm:
  * (SEMVER-MINOR) add `--experimental-import-text` flag (Efe) https://github.com/nodejs/node/pull/62300
perf_hooks:
  * (SEMVER-MINOR) sample delay per event loop iteration (Pablo Erhard) https://github.com/nodejs/node/pull/62935
stream:
  * (SEMVER-MINOR) expose ReadableStreamTee (Matteo Collina) https://github.com/nodejs/node/pull/64195
tls:
  * (SEMVER-MINOR) report negotiated TLS groups (Filip Skokan) https://github.com/nodejs/node/pull/64119

PR-URL: https://github.com/nodejs/node/pull/64329
Signed-off-by: Richard Lau <richard.lau@ibm.com>
2026-07-08 11:48:20 +00:00
Moshe Atlow f4c85d5d82 test_runner: report entryFile in TestStream events
Signed-off-by: Moshe Atlov <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/64309
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-07-07 15:29:21 +00:00
Chengzhong Wu 94164da441 doc: remove obsolete --napi-modules doc entry
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64220
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
2026-07-07 15:29:10 +00:00
Matteo Collina ec8b9f49bf http2: skip trailers round trip for compat responses
The compat layer always responded with waitForTrailers set, so every
response paid for a wantTrailers C++ -> JS callback, an empty
sendTrailers() submission scheduled through setImmediate(), and an
extra empty DATA frame on the wire, even though the vast majority of
responses never register any trailers.

When the headers are flushed as part of response.end() and no
trailers have been registered, there is no further opportunity to
add trailers, so waitForTrailers can be skipped altogether. Headers
flushed early (writeHead, write, flushHeaders) keep the previous
behavior so trailers can still be added while streaming.

Trailers added after response.end() are now silently dropped,
matching the HTTP/1 response.addTrailers() semantics.

Also reuse a shared options object for Http2ServerRequest instances
created without explicit options.

h2load, 1 KiB response payload, -c 4 -m 100, mean of 6 alternating
runs: compat API 43.1k -> 49.9k req/s (+15.7% cumulative vs main).

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64265
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-07-07 14:24:12 +00:00
EduardF1 90fbf0ec0a doc: clarify QUIC stream state wording
When the body option is omitted, no FIN is sent immediately and the
stream's outgoing side remains writable. The stream can still be
written later via stream.setBody() or the writer.

Avoid describing the outgoing stream itself as half-closed, since the
outgoing side is one half of the stream state.

Fixes: https://github.com/nodejs/node/issues/63655
Signed-off-by: EduardF1 <50618110+EduardF1@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/63660
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-06 13:25:25 +00:00
YuSheng Chen aa9eeab27a doc: update Http2SecureServer.on("timeout") default value
Signed-off-by: YuSheng Chen <samuel871211@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64187
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-07-06 12:40:35 +00:00
Matteo CollinaandAntoine du Hamel 90d6955e85 doc: clarify HTTP/1.1 response ordering
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64213
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-07-06 11:22:23 +00:00
Matteo Collina 4d27d802e6 stream: expose ReadableStreamTee
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64195
Refs: https://github.com/nodejs/undici/issues/5358
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-05 08:04:44 +00:00
Joyee Cheung a006c5dd12 esm: improve ERR_REQUIRE_ASYNC_MODULE
This brings back several improvements that were reverted by mistake when
landing https://redirect.github.com/nodejs/node/pull/64154

- Update the documentation about how the removal of side effects of
  source collection
- Add non-enumerable `requireStack` and `topLevelAwaitLocations`
  properties to `ERR_REQUIRE_ASYNC_MODULE`, the latter is only
  populated when --experimental-print-required-tla is enabled
- Add "Required module: <url>" to the error message to identify the
  required ESM entry point regardless of whether the flag is enabled
- Fix TLA caret column from 0-based to 1-based
- Store module source via a private symbol instead of a public property
- Use `hasAsyncGraph` (post-instantiation) in `throwIfAsyncGraph`
  instead of walking the graph before instantiation
- Merge the require stack checking into the
  `common.expectRequiredTLAError` helper.
- Removed tests that are made redundant by the snapshot tests

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64260
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-04 15:22:48 +00:00
Vas Sudanagunta 51dbfd607c doc: fix typo in examples
Signed-off-by: vassudanagunta <vas@commonkarma.org>
PR-URL: https://github.com/nodejs/node/pull/64184
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-07-04 09:42:38 +00:00
Chengzhong Wu 5d8693e124 module: enable import support for addons by default
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64221
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-02 19:21:02 +00:00
Joyee Cheung 85c31dfae1 esm: print required top-level await locations without evaluating
Previously in order to collect the locations of the TLA, we wait
until right before evalutation to ensure instantiation is
completed so that we can use
v8::Module::GetStalledTopLevelAwaitMessages(). Now we try to
add an additioanl shortcut to the source code in the module wraps
instead during compilation for modules that contain TLAs and
use acron to locate the TLAs when we need to throw
ERR_REQUIRE_AYNSC_MODULE, so we can do this as early as before
instantiation and do not need to run the module again to collect
the locations.

In addition, we now collect the require stack for
ERR_REQUIRE_ASYNC_MODULE too for better metadata in the errors.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64154
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-07-02 09:42:32 +00:00
Daijiro Wachi ed33235bda doc: fix Fast FFI argument count in ffi.md
The text said functions with more than 7 arguments fall back to the
generic call path, contradicting the preceding sentence that Fast FFI
calls support up to 8 arguments.

The real limit is architecture- and type-dependent: the hard cap is 8
public arguments (src/ffi/fast.cc), but register pressure lowers the
effective count to 7 integer/pointer arguments on AArch64 and 6 on
x86-64, while floating-point arguments can use up to 8 on both. Describe
this instead of the previous, inaccurate single threshold.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63960
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-07-01 11:49:20 +00:00
Joyee Cheung fd3419178e http: document and validate options.path when it's in absolute-form
When `options.path` passed to `http.request()` contains an absolute
URL, `http.request` has been sending it directly as the request target
in the HTTP 1.1 message. If the receiving server is a proxy,
the proxy server typically forwards the request to the destination
specified in the request target and ignores the Host header.
This means eventually the request can be forwarded to a destination
that is not consistent with `options.host`, depending on how the
receiving server behaves. Mimatched Host header and request target
also violates RFC 9112 Section 3.2, which we have been entirely
leaving to the users to verify.

This patch documents this behavior and warns that the user needs
to ensure the `path`, `option` and `headers` conform to the RFC.
If the receiving server is known to be a proxy server because
the request is routed by Node.js' built-in HTTP proxy support,
we now do a best-effort check to verify that the authority in
`options.path` (if absolute), Host headers and `options.host`
agree at request construction time. Node.js will give up on the
require target rewriting and throw an error when they don't match
at request construction.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64108
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-07-01 10:44:52 +00:00