Skip to content

Commit dc8aca3

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: update undici to 6.21.0
PR-URL: #55851 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
1 parent e0ef65b commit dc8aca3

19 files changed

Lines changed: 147 additions & 201 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ const setupConnectTimeout = process.platform === 'win32'
220220
* @param {number} opts.port
221221
*/
222222
functiononConnectTimeout(socket,opts){
223+
// The socket could be already garbage collected
224+
if(socket==null){
225+
return
226+
}
227+
223228
letmessage='Connect Timeout Error'
224229
if(Array.isArray(socket.autoSelectFamilyAttemptedAddresses)){
225230
message+=` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`

‎deps/undici/src/lib/handler/retry-handler.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class RetryHandler {
229229
returnfalse
230230
}
231231

232-
const{ start, size, end =size}=contentRange
232+
const{ start, size, end =size-1}=contentRange
233233

234234
assert(this.start===start,'content-range mismatch')
235235
assert(this.end==null||this.end===end,'content-range mismatch')
@@ -252,7 +252,7 @@ class RetryHandler {
252252
)
253253
}
254254

255-
const{ start, size, end =size}=range
255+
const{ start, size, end =size-1}=range
256256
assert(
257257
start!=null&&Number.isFinite(start),
258258
'content-range mismatch'
@@ -266,7 +266,7 @@ class RetryHandler {
266266
// We make our best to checkpoint the body for further range headers
267267
if(this.end==null){
268268
constcontentLength=headers['content-length']
269-
this.end=contentLength!=null ? Number(contentLength) : null
269+
this.end=contentLength!=null ? Number(contentLength)-1: null
270270
}
271271

272272
assert(Number.isFinite(this.start))

‎deps/undici/src/lib/llhttp/wasm_build_env.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

2-
> undici@6.20.1 prebuild:wasm
2+
> undici@6.21.0 prebuild:wasm
33
> node build/wasm.js --prebuild
44

55
> docker build --platform=linux/x86_64 -t llhttp_wasm_builder -f /home/runner/work/node/node/deps/undici/src/build/Dockerfile /home/runner/work/node/node/deps/undici/src
66

77

88

9-
> undici@6.20.1 build:wasm
9+
> undici@6.21.0 build:wasm
1010
> node build/wasm.js --docker
1111

1212
> docker run --rm -t --platform=linux/x86_64 --user 1001:127 --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/lib/llhttp,target=/home/node/undici/lib/llhttp llhttp_wasm_builder node build/wasm.js

‎deps/undici/src/lib/web/cache/cache.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Cache {
3737
webidl.illegalConstructor()
3838
}
3939

40+
webidl.util.markAsUncloneable(this)
4041
this.#relevantRequestResponseList =arguments[1]
4142
}
4243

‎deps/undici/src/lib/web/cache/cachestorage.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class CacheStorage {
1616
if(arguments[0]!==kConstruct){
1717
webidl.illegalConstructor()
1818
}
19+
20+
webidl.util.markAsUncloneable(this)
1921
}
2022

2123
asyncmatch(request,options={}){

‎deps/undici/src/lib/web/eventsource/eventsource.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ class EventSource extends EventTarget {
105105
// 1. Let ev be a new EventSource object.
106106
super()
107107

108+
webidl.util.markAsUncloneable(this)
109+
108110
constprefix='EventSource constructor'
109111
webidl.argumentLengthCheck(arguments,1,prefix)
110112

‎deps/undici/src/lib/web/fetch/formdata.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const File = globalThis.File ?? NativeFile
1414
// https://xhr.spec.whatwg.org/#formdata
1515
classFormData{
1616
constructor(form){
17+
webidl.util.markAsUncloneable(this)
18+
1719
if(form!==undefined){
1820
throwwebidl.errors.conversionFailed({
1921
prefix: 'FormData constructor',

‎deps/undici/src/lib/web/fetch/headers.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ class Headers {
359359
#headersList
360360

361361
constructor(init=undefined){
362+
webidl.util.markAsUncloneable(this)
363+
362364
if(init===kConstruct){
363365
return
364366
}

‎deps/undici/src/lib/web/fetch/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ async function httpNetworkFetch (
21372137

21382138
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
21392139
if(codings.length!==0&&request.method!=='HEAD'&&request.method!=='CONNECT'&&!nullBodyStatus.includes(status)&&!willFollow){
2140-
for(leti=0;i<codings.length;++i){
2140+
for(leti=codings.length-1;i>=0;--i){
21412141
constcoding=codings[i]
21422142
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
21432143
if(coding==='x-gzip'||coding==='gzip'){

‎deps/undici/src/lib/web/fetch/request.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ let patchMethodWarning = false
8282
classRequest{
8383
// https://fetch.spec.whatwg.org/#dom-request
8484
constructor(input,init={}){
85+
webidl.util.markAsUncloneable(this)
8586
if(input===kConstruct){
8687
return
8788
}

0 commit comments

Comments
 (0)