Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 588784e

Browse filesBrowse files
deps: update undici to 5.25.4
PR-URL: #50025 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent fce8fba commit 588784e
Copy full SHA for 588784e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

56 files changed

+3375
-8777
lines changed
Open diff view settings
Collapse file

‎deps/undici/src/lib/compat/dispatcher-weakref.js‎

Copy file name to clipboardExpand all lines: deps/undici/src/lib/compat/dispatcher-weakref.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ class CompatFinalizer {
3131
}
3232

3333
module.exports = function () {
34+
// FIXME: remove workaround when the Node bug is fixed
35+
// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
36+
if (process.env.NODE_V8_COVERAGE) {
37+
return {
38+
WeakRef: CompatWeakRef,
39+
FinalizationRegistry: CompatFinalizer
40+
}
41+
}
3442
return {
3543
WeakRef: global.WeakRef || CompatWeakRef,
3644
FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
Collapse file

‎deps/undici/src/lib/core/connect.js‎

Copy file name to clipboardExpand all lines: deps/undici/src/lib/core/connect.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ let tls // include tls conditionally since it is not always available
1313
// re-use is enabled.
1414

1515
let SessionCache
16-
if (global.FinalizationRegistry) {
16+
// FIXME: remove workaround when the Node bug is fixed
17+
// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
18+
if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
1719
SessionCache = class WeakSessionCache {
1820
constructor (maxCachedSessions) {
1921
this._maxCachedSessions = maxCachedSessions
Collapse file

‎deps/undici/src/lib/core/util.js‎

Copy file name to clipboardExpand all lines: deps/undici/src/lib/core/util.js
+18-18Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,31 @@ function parseURL (url) {
5858
throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
5959
}
6060

61-
if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
62-
throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
61+
if (!/^https?:/.test(url.origin || url.protocol)) {
62+
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
6363
}
6464

65-
if (url.path != null && typeof url.path !== 'string') {
66-
throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
67-
}
65+
if (!(url instanceof URL)) {
66+
if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
67+
throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
68+
}
6869

69-
if (url.pathname != null && typeof url.pathname !== 'string') {
70-
throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
71-
}
70+
if (url.path != null && typeof url.path !== 'string') {
71+
throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
72+
}
7273

73-
if (url.hostname != null && typeof url.hostname !== 'string') {
74-
throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
75-
}
74+
if (url.pathname != null && typeof url.pathname !== 'string') {
75+
throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
76+
}
7677

77-
if (url.origin != null && typeof url.origin !== 'string') {
78-
throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
79-
}
78+
if (url.hostname != null && typeof url.hostname !== 'string') {
79+
throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
80+
}
8081

81-
if (!/^https?:/.test(url.origin || url.protocol)) {
82-
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
83-
}
82+
if (url.origin != null && typeof url.origin !== 'string') {
83+
throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
84+
}
8485

85-
if (!(url instanceof URL)) {
8686
const port = url.port != null
8787
? url.port
8888
: (url.protocol === 'https:' ? 443 : 80)
Collapse file

‎deps/undici/src/lib/fetch/body.js‎

Copy file name to clipboardExpand all lines: deps/undici/src/lib/fetch/body.js
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const Busboy = require('busboy')
3+
const Busboy = require('@fastify/busboy')
44
const util = require('../core/util')
55
const {
66
ReadableStreamFrom,
@@ -385,10 +385,9 @@ function bodyMixinMethods (instance) {
385385
let busboy
386386

387387
try {
388-
busboy = Busboy({
388+
busboy = new Busboy({
389389
headers,
390-
preservePath: true,
391-
defParamCharset: 'utf8'
390+
preservePath: true
392391
})
393392
} catch (err) {
394393
throw new DOMException(`${err}`, 'AbortError')
@@ -397,8 +396,7 @@ function bodyMixinMethods (instance) {
397396
busboy.on('field', (name, value) => {
398397
responseFormData.append(name, value)
399398
})
400-
busboy.on('file', (name, value, info) => {
401-
const { filename, encoding, mimeType } = info
399+
busboy.on('file', (name, value, filename, encoding, mimeType) => {
402400
const chunks = []
403401

404402
if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
Collapse file

‎deps/undici/src/lib/fetch/global.js‎

Copy file name to clipboardExpand all lines: deps/undici/src/lib/fetch/global.js
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ function getGlobalOrigin () {
99
}
1010

1111
function setGlobalOrigin (newOrigin) {
12-
if (
13-
newOrigin !== undefined &&
14-
typeof newOrigin !== 'string' &&
15-
!(newOrigin instanceof URL)
16-
) {
17-
throw new Error('Invalid base url')
18-
}
19-
2012
if (newOrigin === undefined) {
2113
Object.defineProperty(globalThis, globalOrigin, {
2214
value: undefined,
Collapse file
File renamed without changes.
Collapse file

‎deps/undici/src/node_modules/@fastify/busboy/README.md‎

Copy file name to clipboardExpand all lines: deps/undici/src/node_modules/@fastify/busboy/README.md
+271Lines changed: 271 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.