mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
deps: update undici to 6.19.2
PR-URL: https://github.com/nodejs/node/pull/53468 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
22
deps/undici/src/lib/web/fetch/body.js
vendored
22
deps/undici/src/lib/web/fetch/body.js
vendored
@@ -309,7 +309,7 @@ function bodyMixinMethods (instance) {
|
||||
// Return a Blob whose contents are bytes and type attribute
|
||||
// is mimeType.
|
||||
return new Blob([bytes], { type: mimeType })
|
||||
}, instance, false)
|
||||
}, instance)
|
||||
},
|
||||
|
||||
arrayBuffer () {
|
||||
@@ -318,21 +318,20 @@ function bodyMixinMethods (instance) {
|
||||
// given a byte sequence bytes: return a new ArrayBuffer
|
||||
// whose contents are bytes.
|
||||
return consumeBody(this, (bytes) => {
|
||||
// Note: arrayBuffer already cloned.
|
||||
return bytes.buffer
|
||||
}, instance, true)
|
||||
return new Uint8Array(bytes).buffer
|
||||
}, instance)
|
||||
},
|
||||
|
||||
text () {
|
||||
// The text() method steps are to return the result of running
|
||||
// consume body with this and UTF-8 decode.
|
||||
return consumeBody(this, utf8DecodeBytes, instance, false)
|
||||
return consumeBody(this, utf8DecodeBytes, instance)
|
||||
},
|
||||
|
||||
json () {
|
||||
// The json() method steps are to return the result of running
|
||||
// consume body with this and parse JSON from bytes.
|
||||
return consumeBody(this, parseJSONFromBytes, instance, false)
|
||||
return consumeBody(this, parseJSONFromBytes, instance)
|
||||
},
|
||||
|
||||
formData () {
|
||||
@@ -384,7 +383,7 @@ function bodyMixinMethods (instance) {
|
||||
throw new TypeError(
|
||||
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
|
||||
)
|
||||
}, instance, false)
|
||||
}, instance)
|
||||
},
|
||||
|
||||
bytes () {
|
||||
@@ -392,8 +391,8 @@ function bodyMixinMethods (instance) {
|
||||
// with this and the following step given a byte sequence bytes: return the
|
||||
// result of creating a Uint8Array from bytes in this’s relevant realm.
|
||||
return consumeBody(this, (bytes) => {
|
||||
return new Uint8Array(bytes.buffer, 0, bytes.byteLength)
|
||||
}, instance, true)
|
||||
return new Uint8Array(bytes)
|
||||
}, instance)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,9 +408,8 @@ function mixinBody (prototype) {
|
||||
* @param {Response|Request} object
|
||||
* @param {(value: unknown) => unknown} convertBytesToJSValue
|
||||
* @param {Response|Request} instance
|
||||
* @param {boolean} [shouldClone]
|
||||
*/
|
||||
async function consumeBody (object, convertBytesToJSValue, instance, shouldClone) {
|
||||
async function consumeBody (object, convertBytesToJSValue, instance) {
|
||||
webidl.brandCheck(object, instance)
|
||||
|
||||
// 1. If object is unusable, then return a promise rejected
|
||||
@@ -449,7 +447,7 @@ async function consumeBody (object, convertBytesToJSValue, instance, shouldClone
|
||||
|
||||
// 6. Otherwise, fully read object’s body given successSteps,
|
||||
// errorSteps, and object’s relevant global object.
|
||||
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone)
|
||||
await fullyReadBody(object[kState].body, successSteps, errorSteps)
|
||||
|
||||
// 7. Return promise.
|
||||
return promise.promise
|
||||
|
||||
14
deps/undici/src/lib/web/fetch/util.js
vendored
14
deps/undici/src/lib/web/fetch/util.js
vendored
@@ -1029,7 +1029,7 @@ function iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueInde
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#body-fully-read
|
||||
*/
|
||||
async function fullyReadBody (body, processBody, processBodyError, shouldClone) {
|
||||
async function fullyReadBody (body, processBody, processBodyError) {
|
||||
// 1. If taskDestination is null, then set taskDestination to
|
||||
// the result of starting a new parallel queue.
|
||||
|
||||
@@ -1055,7 +1055,7 @@ async function fullyReadBody (body, processBody, processBodyError, shouldClone)
|
||||
|
||||
// 5. Read all bytes from reader, given successSteps and errorSteps.
|
||||
try {
|
||||
successSteps(await readAllBytes(reader, shouldClone))
|
||||
successSteps(await readAllBytes(reader))
|
||||
} catch (e) {
|
||||
errorSteps(e)
|
||||
}
|
||||
@@ -1103,9 +1103,8 @@ function isomorphicEncode (input) {
|
||||
* @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
|
||||
* @see https://streams.spec.whatwg.org/#read-loop
|
||||
* @param {ReadableStreamDefaultReader} reader
|
||||
* @param {boolean} [shouldClone]
|
||||
*/
|
||||
async function readAllBytes (reader, shouldClone) {
|
||||
async function readAllBytes (reader) {
|
||||
const bytes = []
|
||||
let byteLength = 0
|
||||
|
||||
@@ -1114,13 +1113,6 @@ async function readAllBytes (reader, shouldClone) {
|
||||
|
||||
if (done) {
|
||||
// 1. Call successSteps with bytes.
|
||||
if (bytes.length === 1) {
|
||||
const { buffer, byteOffset, byteLength } = bytes[0]
|
||||
if (shouldClone === false) {
|
||||
return Buffer.from(buffer, byteOffset, byteLength)
|
||||
}
|
||||
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength), 0, byteLength)
|
||||
}
|
||||
return Buffer.concat(bytes, byteLength)
|
||||
}
|
||||
|
||||
|
||||
4
deps/undici/src/package-lock.json
generated
vendored
4
deps/undici/src/package-lock.json
generated
vendored
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "undici",
|
||||
"version": "6.19.1",
|
||||
"version": "6.19.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "undici",
|
||||
"version": "6.19.1",
|
||||
"version": "6.19.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@fastify/busboy": "2.1.1",
|
||||
|
||||
6
deps/undici/src/package.json
vendored
6
deps/undici/src/package.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "undici",
|
||||
"version": "6.19.1",
|
||||
"version": "6.19.2",
|
||||
"description": "An HTTP/1.1 client, written from scratch for Node.js",
|
||||
"homepage": "https://undici.nodejs.org",
|
||||
"bugs": {
|
||||
@@ -85,7 +85,7 @@
|
||||
"test:node-test": "borp -p \"test/node-test/**/*.js\"",
|
||||
"test:tdd": "borp --expose-gc -p \"test/*.js\"",
|
||||
"test:tdd:node-test": "borp -p \"test/node-test/**/*.js\" -w",
|
||||
"test:typescript": "tsd && tsc --skipLibCheck test/imports/undici-import.ts",
|
||||
"test:typescript": "tsd && tsc test/imports/undici-import.ts --typeRoots ./types && tsc ./types/*.d.ts --noEmit --typeRoots ./types",
|
||||
"test:webidl": "borp -p \"test/webidl/*.js\"",
|
||||
"test:websocket": "borp -p \"test/websocket/*.js\"",
|
||||
"test:websocket:autobahn": "node test/autobahn/client.js",
|
||||
@@ -99,7 +99,7 @@
|
||||
"coverage:report:ci": "c8 report",
|
||||
"bench": "echo \"Error: Benchmarks have been moved to '/benchmarks'\" && exit 1",
|
||||
"serve:website": "echo \"Error: Documentation has been moved to '/docs'\" && exit 1",
|
||||
"prepare": "husky install && node ./scripts/platform-shell.js"
|
||||
"prepare": "husky && node ./scripts/platform-shell.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fastify/busboy": "2.1.1",
|
||||
|
||||
2
deps/undici/src/types/formdata.d.ts
vendored
2
deps/undici/src/types/formdata.d.ts
vendored
@@ -2,7 +2,7 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { File } from './file'
|
||||
import { SpecIterator, SpecIterableIterator } from './fetch'
|
||||
import { SpecIterableIterator } from './fetch'
|
||||
|
||||
/**
|
||||
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
||||
|
||||
8
deps/undici/src/types/index.d.ts
vendored
8
deps/undici/src/types/index.d.ts
vendored
@@ -42,7 +42,7 @@ declare namespace Undici {
|
||||
var RedirectHandler: typeof import ('./handlers').RedirectHandler
|
||||
var DecoratorHandler: typeof import ('./handlers').DecoratorHandler
|
||||
var RetryHandler: typeof import ('./retry-handler').default
|
||||
var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor
|
||||
var createRedirectInterceptor: typeof import ('./interceptors').default.createRedirectInterceptor
|
||||
var BalancedPool: typeof import('./balanced-pool').default;
|
||||
var Client: typeof import('./client').default;
|
||||
var buildConnector: typeof import('./connector').default;
|
||||
@@ -67,9 +67,5 @@ declare namespace Undici {
|
||||
var File: typeof import('./file').File;
|
||||
var FileReader: typeof import('./filereader').FileReader;
|
||||
var caches: typeof import('./cache').caches;
|
||||
var interceptors: {
|
||||
dump: typeof import('./interceptors').dump;
|
||||
retry: typeof import('./interceptors').retry;
|
||||
redirect: typeof import('./interceptors').redirect;
|
||||
}
|
||||
var interceptors: typeof import('./interceptors').default;
|
||||
}
|
||||
|
||||
18
deps/undici/src/types/interceptors.d.ts
vendored
18
deps/undici/src/types/interceptors.d.ts
vendored
@@ -1,11 +1,15 @@
|
||||
import Dispatcher from "./dispatcher";
|
||||
import RetryHandler from "./retry-handler";
|
||||
|
||||
export type DumpInterceptorOpts = { maxSize?: number }
|
||||
export type RetryInterceptorOpts = RetryHandler.RetryOptions
|
||||
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
||||
export default Interceptors;
|
||||
|
||||
export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export declare function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export declare function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export declare function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
declare namespace Interceptors {
|
||||
export type DumpInterceptorOpts = { maxSize?: number }
|
||||
export type RetryInterceptorOpts = RetryHandler.RetryOptions
|
||||
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
||||
|
||||
export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
}
|
||||
|
||||
3
deps/undici/src/types/retry-agent.d.ts
vendored
3
deps/undici/src/types/retry-agent.d.ts
vendored
@@ -1,7 +1,4 @@
|
||||
import Agent from './agent'
|
||||
import buildConnector from './connector';
|
||||
import Dispatcher from './dispatcher'
|
||||
import { IncomingHttpHeaders } from './header'
|
||||
import RetryHandler from './retry-handler'
|
||||
|
||||
export default RetryAgent
|
||||
|
||||
4
deps/undici/src/types/webidl.d.ts
vendored
4
deps/undici/src/types/webidl.d.ts
vendored
@@ -55,9 +55,7 @@ interface WebidlUtil {
|
||||
V: unknown,
|
||||
bitLength: number,
|
||||
signedness: 'signed' | 'unsigned',
|
||||
opts?: ConvertToIntOpts,
|
||||
prefix: string,
|
||||
argument: string
|
||||
opts?: ConvertToIntOpts
|
||||
): number
|
||||
|
||||
/**
|
||||
|
||||
33
deps/undici/undici.js
vendored
33
deps/undici/undici.js
vendored
@@ -4367,7 +4367,7 @@ var require_util2 = __commonJS({
|
||||
});
|
||||
}
|
||||
__name(iteratorMixin, "iteratorMixin");
|
||||
async function fullyReadBody(body, processBody, processBodyError, shouldClone) {
|
||||
async function fullyReadBody(body, processBody, processBodyError) {
|
||||
const successSteps = processBody;
|
||||
const errorSteps = processBodyError;
|
||||
let reader;
|
||||
@@ -4378,7 +4378,7 @@ var require_util2 = __commonJS({
|
||||
return;
|
||||
}
|
||||
try {
|
||||
successSteps(await readAllBytes(reader, shouldClone));
|
||||
successSteps(await readAllBytes(reader));
|
||||
} catch (e) {
|
||||
errorSteps(e);
|
||||
}
|
||||
@@ -4405,19 +4405,12 @@ var require_util2 = __commonJS({
|
||||
return input;
|
||||
}
|
||||
__name(isomorphicEncode, "isomorphicEncode");
|
||||
async function readAllBytes(reader, shouldClone) {
|
||||
async function readAllBytes(reader) {
|
||||
const bytes = [];
|
||||
let byteLength = 0;
|
||||
while (true) {
|
||||
const { done, value: chunk } = await reader.read();
|
||||
if (done) {
|
||||
if (bytes.length === 1) {
|
||||
const { buffer, byteOffset, byteLength: byteLength2 } = bytes[0];
|
||||
if (shouldClone === false) {
|
||||
return Buffer.from(buffer, byteOffset, byteLength2);
|
||||
}
|
||||
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength2), 0, byteLength2);
|
||||
}
|
||||
return Buffer.concat(bytes, byteLength);
|
||||
}
|
||||
if (!isUint8Array(chunk)) {
|
||||
@@ -5393,18 +5386,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
||||
mimeType = serializeAMimeType(mimeType);
|
||||
}
|
||||
return new Blob2([bytes], { type: mimeType });
|
||||
}, instance, false);
|
||||
}, instance);
|
||||
},
|
||||
arrayBuffer() {
|
||||
return consumeBody(this, (bytes) => {
|
||||
return bytes.buffer;
|
||||
}, instance, true);
|
||||
return new Uint8Array(bytes).buffer;
|
||||
}, instance);
|
||||
},
|
||||
text() {
|
||||
return consumeBody(this, utf8DecodeBytes, instance, false);
|
||||
return consumeBody(this, utf8DecodeBytes, instance);
|
||||
},
|
||||
json() {
|
||||
return consumeBody(this, parseJSONFromBytes, instance, false);
|
||||
return consumeBody(this, parseJSONFromBytes, instance);
|
||||
},
|
||||
formData() {
|
||||
return consumeBody(this, (value) => {
|
||||
@@ -5433,12 +5426,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
||||
throw new TypeError(
|
||||
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
|
||||
);
|
||||
}, instance, false);
|
||||
}, instance);
|
||||
},
|
||||
bytes() {
|
||||
return consumeBody(this, (bytes) => {
|
||||
return new Uint8Array(bytes.buffer, 0, bytes.byteLength);
|
||||
}, instance, true);
|
||||
return new Uint8Array(bytes);
|
||||
}, instance);
|
||||
}
|
||||
};
|
||||
return methods;
|
||||
@@ -5448,7 +5441,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
||||
Object.assign(prototype.prototype, bodyMixinMethods(prototype));
|
||||
}
|
||||
__name(mixinBody, "mixinBody");
|
||||
async function consumeBody(object, convertBytesToJSValue, instance, shouldClone) {
|
||||
async function consumeBody(object, convertBytesToJSValue, instance) {
|
||||
webidl.brandCheck(object, instance);
|
||||
if (bodyUnusable(object[kState].body)) {
|
||||
throw new TypeError("Body is unusable: Body has already been read");
|
||||
@@ -5467,7 +5460,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
||||
successSteps(Buffer.allocUnsafe(0));
|
||||
return promise.promise;
|
||||
}
|
||||
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone);
|
||||
await fullyReadBody(object[kState].body, successSteps, errorSteps);
|
||||
return promise.promise;
|
||||
}
|
||||
__name(consumeBody, "consumeBody");
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
// Refer to tools/dep_updaters/update-undici.sh
|
||||
#ifndef SRC_UNDICI_VERSION_H_
|
||||
#define SRC_UNDICI_VERSION_H_
|
||||
#define UNDICI_VERSION "6.19.1"
|
||||
#define UNDICI_VERSION "6.19.2"
|
||||
#endif // SRC_UNDICI_VERSION_H_
|
||||
|
||||
Reference in New Issue
Block a user