Skip to content

Commit 61b4afb

Browse files
nodejs-github-botrichardlau
authored andcommitted
deps: update undici to 5.26.4
PR-URL: #50274 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent a60fbf2 commit 61b4afb

File tree

10 files changed

+15484
-116
lines changed

10 files changed

+15484
-116
lines changed

deps/undici/src/docs/api/DispatchInterceptor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Interface: DispatchInterceptor
1+
# Interface: DispatchInterceptor
22

33
Extends: `Function`
44

deps/undici/src/lib/api/api-stream.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class StreamHandler extends AsyncResource {
104104
{ callback, body: res, contentType, statusCode, statusMessage, headers }
105105
)
106106
} else {
107+
if (factory === null) {
108+
return
109+
}
110+
107111
res = this.runInAsyncScope(factory, null, {
108112
statusCode,
109113
headers,
@@ -152,14 +156,18 @@ class StreamHandler extends AsyncResource {
152156
onData (chunk) {
153157
const { res } = this
154158

155-
return res.write(chunk)
159+
return res ? res.write(chunk) : true
156160
}
157161

158162
onComplete (trailers) {
159163
const { res } = this
160164

161165
removeSignal(this)
162166

167+
if (!res) {
168+
return
169+
}
170+
163171
this.trailers = util.parseHeaders(trailers)
164172

165173
res.end()

deps/undici/src/lib/api/readable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function consumeEnd (consume) {
268268
pos += buf.byteLength
269269
}
270270

271-
resolve(dst)
271+
resolve(dst.buffer)
272272
} else if (type === 'blob') {
273273
if (!Blob) {
274274
Blob = require('buffer').Blob

deps/undici/src/lib/client.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,9 @@ function onParserTimeout (parser) {
10701070

10711071
function onSocketReadable () {
10721072
const { [kParser]: parser } = this
1073-
parser.readMore()
1073+
if (parser) {
1074+
parser.readMore()
1075+
}
10741076
}
10751077

10761078
function onSocketError (err) {

0 commit comments

Comments
 (0)