Guy Bedford
04865cf6f0
bootstrap: correct --frozen-intrinsics override fix
...
PR-URL: https://github.com/nodejs/node/pull/35041
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-09-06 16:48:14 -07:00
Rich Trott
53f7d3ee2c
crypto: align parameter names with documentation
...
Change _cb_ to _callback_ to align with documentation. This is so that
stack traces and error messages align with the documentation. If the
documentation says "callback", then the stack traces and error messages
should indicate that "callback" needs to be function or whatever, rather
than "cb".
PR-URL: https://github.com/nodejs/node/pull/35054
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2020-09-06 09:59:27 -07:00
Rich Trott
186230527b
quic: fix error message on invalid connection ID
...
If Buffer.from() throws, it does not return a value, so the error
message is always going to report `undefined`. Use the value passed to
Buffer.from() instead.
PR-URL: https://github.com/nodejs/node/pull/35026
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2020-09-04 22:09:07 -07:00
Oli Lalonde
6e8701b923
crypto: add randomInt function
...
PR-URL: https://github.com/nodejs/node/pull/34600
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2020-09-04 10:51:13 +02:00
Rich Trott
e5116b304f
quic: remove unused function arguments
...
validateTransportParams() only takes (and only uses) one argument.
PR-URL: https://github.com/nodejs/node/pull/35010
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2020-09-03 19:54:10 -07:00
Rich Trott
449f73e05f
quic: remove undefined variable
...
The `reason` variable never gets defined. It's use in a template string
will always end up as the string `'undefined'`.
PR-URL: https://github.com/nodejs/node/pull/35007
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2020-09-03 05:25:06 -07:00
Anna Henningsen
42a793eba3
buffer: also alias BigUInt methods
...
These were overlooked in 5864fca7bc because of the extra
`Big` in the name. :)
Refs: https://github.com/nodejs/node/pull/34729
PR-URL: https://github.com/nodejs/node/pull/34960
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2020-09-02 14:22:35 +00:00
James M Snell
883fc779b6
events: allow use of AbortController with once
...
Allows an AbortSignal to be passed in to events.once() to cancel
waiting on an event.
Signed-off-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/34911
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2020-08-31 15:09:57 +00:00
James M Snell
37a8179673
net: make blocklist family case insensitive
...
Signed-off-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/34864
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2020-08-31 15:09:47 +00:00
Rich Trott
e1edd6bbfa
esm: shorten ERR_UNSUPPORTED_ESM_URL_SCHEME message
...
I know it just got modified to include new information, but this
shortens the message a bit without (I hope) losing clarity or meaning.
PR-URL: https://github.com/nodejs/node/pull/34836
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
2020-08-30 09:18:02 -07:00
Bradley Farias
4234904232
policy: implement scopes field
...
PR-URL: https://github.com/nodejs/node/pull/34552
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-26 14:35:34 -05:00
ExE Boss
565d993968
errors: use ErrorPrototypeToString from primordials object
...
PR-URL: https://github.com/nodejs/node/pull/34891
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-08-26 13:33:13 +00:00
João Lucas Lucchetta
f5102fbcf4
http2: fix Http2Response.sendDate
...
The `sendDate` flag was not being respected
by the current implementation and the `Date`
header was being sent regardless of the config.
This commit fixes that and adds tests for this case.
Fixes: https://github.com/nodejs/node/issues/34841
PR-URL: https://github.com/nodejs/node/pull/34850
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-22 12:49:11 -07:00
Antoine du HAMEL
ffa5b068ce
workers: add support for data: URLs
...
PR-URL: https://github.com/nodejs/node/pull/34584
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-08-19 12:33:43 -07:00
Denys Otrishko
a0846326dd
esm: improve error message of ERR_UNSUPPORTED_ESM_URL_SCHEME
...
Refs: https://github.com/nodejs/node/issues/34765
PR-URL: https://github.com/nodejs/node/pull/34795
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-18 17:56:47 -07:00
Rich Trott
15fdd9861b
doc,lib: remove unused error code
...
As best as I can tell, ERR_V8BREAKITERATOR is unused anywhere in our
code base and dependencies. Move to legacy errors.
PR-URL: https://github.com/nodejs/node/pull/34792
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2020-08-17 22:05:23 -07:00
Denys Otrishko
6726246dbb
lib: allow to validate enums with validateOneOf
...
PR-URL: https://github.com/nodejs/node/pull/34070
Reviewed-By: Zeyu Yang <himself65@outlook.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-17 11:50:46 -07:00
James M Snell
c855c3e8ca
quic: use net.BlockList for limiting access to a QuicSocket
...
PR-URL: https://github.com/nodejs/node/pull/34741
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-17 11:31:28 -07:00
James M Snell
1c14810edc
src: allow instances of net.BlockList to be created internally
...
Initial PR had it so that user code would create BlockList
instances. This sets it up so that instances can be created
internally by Node.js
PR-URL: https://github.com/nodejs/node/pull/34741
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-17 11:31:26 -07:00
James M Snell
442968c92a
quic: check setSocket natRebinding argument, extend test
...
PR-URL: https://github.com/nodejs/node/pull/34669
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2020-08-17 11:27:32 -07:00
James M Snell
10d5047a4f
quic: fixup set_socket, fix skipped test
...
PR-URL: https://github.com/nodejs/node/pull/34669
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2020-08-17 11:27:30 -07:00
James M Snell
344c5e4e50
quic: limit push check to http/3
...
PR-URL: https://github.com/nodejs/node/pull/34655
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-17 11:23:28 -07:00
James M Snell
34165f03aa
quic: resolve some minor TODOs
...
PR-URL: https://github.com/nodejs/node/pull/34655
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-17 11:23:25 -07:00
Carlos Lopez
0e30c5bc26
http2: use and support non-empty DATA frame with END_STREAM flag
...
Adds support for reading from a stream where the final frame is a
non-empty DATA frame with the END_STREAM flag set, instead of hanging
waiting for another frame. When writing to a stream, uses a
END_STREAM flag on final DATA frame instead of adding an empty
DATA frame.
BREAKING: http2 client now expects servers to properly support
END_STREAM flag
Fixes: https://github.com/nodejs/node/issues/31309
Fixes: https://github.com/nodejs/node/issues/33891
Refs: https://nghttp2.org/documentation/types.html#c.nghttp2_on_data_chunk_recv_callback
PR-URL: https://github.com/nodejs/node/pull/33875
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-17 14:26:01 +02:00
Alba Mendez
f5c0e282cc
http2: allow Host in HTTP/2 requests
...
The HTTP/2 spec allows Host to be used instead of :authority in
requests, and this is in fact *preferred* when converting from HTTP/1.
We erroneously treated Host as a connection header, thus disallowing
it in requests. The patch corrects this, aligning Node.js behaviour
with the HTTP/2 spec and with nghttp2:
- Treat Host as a single-value header instead of a connection header.
- Don't autofill :authority if Host is present.
- The compatibility API (request.authority) falls back to using Host
if :authority is not present.
This is semver-major because requests are no longer guaranteed to
have :authority set. An explanatory note was added to the docs.
Fixes: https://github.com/nodejs/node/issues/29858
PR-URL: https://github.com/nodejs/node/pull/34664
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
2020-08-17 13:49:59 +02:00
Anna Henningsen
ba5c64bf45
quic: use AbortController with correct name/message
...
On the web, `AbortError` is the error name, not the error
message. Change the code to match that.
PR-URL: https://github.com/nodejs/node/pull/34763
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-15 14:48:05 -07:00
Denys Otrishko
8da8ec9c7e
errors: improve ERR_INVALID_OPT_VALUE error
...
* use util.inspect for value presentation
* allow to optionally specify error reason
PR-URL: https://github.com/nodejs/node/pull/34671
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
2020-08-14 19:32:09 -07:00
Derek Lewis and Guy Bedford
0347574834
module: fix check for package.json at volume root
...
This patch converts the "read package scope" algorithm's while loop
into a do-while loop enabling items at the filesystem root dir to
be considered within the scope of a sibling package.json also at the
filesystem root dir.
Fixes: https://github.com/nodejs/node/issues/33438
Co-authored-by: Guy Bedford <guybedford@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/34595
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
2020-08-15 02:22:13 +00:00
Robert Nagy
a0f87aab10
fs: guard against undefined behavior
...
Calling close on a file description which is currently in use is
undefined behavior due to implementation details in libuv. Add
a guard against this when using FileHandle.
PR-URL: https://github.com/nodejs/node/pull/34746
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-14 10:22:43 +02:00
Anna Henningsen
5864fca7bc
buffer: alias UInt ➡️ Uint in buffer methods
...
It’s *so* hard to remember that it’s `UintXArray` but not
`(write|read)UintX`. Let’s fix that by just providing aliases. 😊
PR-URL: https://github.com/nodejs/node/pull/34729
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-13 19:57:39 -07:00
Matthew McEachen
7b8c6b0c00
lib: add UNC support to url.pathToFileURL()
...
Fixes: https://github.com/nodejs/node/issues/34736
PR-URL: https://github.com/nodejs/node/pull/34743
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-13 19:43:02 -07:00
Bradley Farias
e155d96014
policy: support conditions for redirects
...
PR-URL: https://github.com/nodejs/node/pull/34414
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2020-08-13 13:17:40 -05:00
Guy Bedford
f8976a76bb
module: share CJS/ESM resolver fns, refactoring
...
PR-URL: https://github.com/nodejs/node/pull/34744
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-13 11:04:24 -07:00
Priyank Singh
3b84048260
http2: add maxHeaderSize option to http2
...
add maxHeaderSize to http2 as an alias for maxHeaderListSize.
Fixes: https://github.com/nodejs/node/issues/33517
PR-URL: https://github.com/nodejs/node/pull/33636
Reviewed-By: Zeyu Yang <himself65@outlook.com >
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2020-08-12 09:58:35 +02:00
Guy Bedford
77a515c31a
module: custom --conditions flag option
...
PR-URL: https://github.com/nodejs/node/pull/34637
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-08-11 14:35:44 -07:00
James M Snell
1f9b20b637
net: introduce net.BlockList
...
`net.BlockList` provides an object intended to be used by net APIs to
specify rules for disallowing network activity with specific IP
addresses. This commit adds the basic mechanism but does not add the
specific uses.
PR-URL: https://github.com/nodejs/node/pull/34625
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
2020-08-11 11:13:17 -07:00
Rich Trott
8a8416f841
lib: use full URL to GitHub issues in comments
...
Don't assume the reader of the code will know where to find the issue
tracker. Provide the full URL. This is especially important if the
issue tracker should move again.
PR-URL: https://github.com/nodejs/node/pull/34686
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-10 16:33:49 -07:00
Bradley Farias
bcfb1762a3
util: add debug and debuglog.enabled
...
PR-URL: https://github.com/nodejs/node/pull/33424
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-10 12:09:43 -05:00
James M Snell
5b6cd6fa1a
quic: use the SocketAddressLRU to track validation status
...
PR-URL: https://github.com/nodejs/node/pull/34618
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-10 07:52:09 -07:00
James M Snell
6b0b33cd4c
quic: cleanup some outstanding todo items
...
PR-URL: https://github.com/nodejs/node/pull/34618
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-10 07:52:01 -07:00
Guy Bedford
0f4b4ea5c6
module: use cjsCache over esm injection
...
PR-URL: https://github.com/nodejs/node/pull/34605
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-09 16:33:30 -07:00
Shelley Vohr
8825eb4d73
lib: use non-symbols in isURLInstance check
...
PR-URL: https://github.com/nodejs/node/pull/34622
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-08 17:18:39 -07:00
Robey Pointer
c0be31f0ef
net: don't return the stream object from onStreamRead
...
CallJSOnreadMethod expects the return value to be undefined or
a new buffer, so make sure to return nothing, even when an error
causes us to destroy the stream.
Fixes: https://github.com/nodejs/node/issues/34346
PR-URL: https://github.com/nodejs/node/pull/34375
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2020-08-08 22:03:10 +02:00
Anna Henningsen
e948ef351b
module: handle Top-Level Await non-fulfills better
...
Handle situations in which the main `Promise` from a TLA module
is not fulfilled better:
- When not resolving the `Promise` at all, set a non-zero exit code
(unless another one has been requested explicitly) to distinguish
the result from a successful completion.
- When rejecting the `Promise`, always treat it like an uncaught
exception. In particular, this also ensures a non-zero exit code.
Refs: https://github.com/nodejs/node/pull/34558
PR-URL: https://github.com/nodejs/node/pull/34640
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2020-08-08 20:33:46 +02:00
Bradley Farias
b04f2b6618
policy: increase tests via permutation matrix
...
PR-URL: https://github.com/nodejs/node/pull/34404
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-08-05 13:48:59 -05:00
James M Snell
744a284ccc
stream: support async for stream impl functions
...
PR-URL: https://github.com/nodejs/node/pull/34416
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
2020-08-03 17:54:08 -07:00
James M Snell
6e65f26b73
quic: use QuicCallbackScope consistently for QuicSession
...
PR-URL: https://github.com/nodejs/node/pull/34541
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2020-08-03 12:03:06 +00:00
James M Snell
4b0275ab87
quic: refactor clientHello
...
Refactor the `'clientHello'` event into a `clientHelloHandler`
configuration option and async function. Remove the addContext
API as it's not needed.
PR-URL: https://github.com/nodejs/node/pull/34541
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2020-08-03 12:03:00 +00:00
Anna Henningsen
2ba93e1db4
async_hooks: fix resource stack for deep stacks
...
460c81dc0e introduced a bug where the execution resource was not
stored properly if we needed to call into C++ to extend the stack size.
Fix that bug by always storing the resource.
Refs: https://github.com/nodejs/node/pull/34319
Fixes: https://github.com/nodejs/node/issues/34556
PR-URL: https://github.com/nodejs/node/pull/34573
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Gus Caplan <me@gus.host >
2020-08-03 10:27:15 +03:00
Gus Caplan
dc00a07426
Revert "module: disable cjs snapshotting into esm loader"
...
This reverts commit 1fe39f0b4b .
PR-URL: https://github.com/nodejs/node/pull/34562
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2020-07-30 14:55:45 -05:00