Skip to content

Commit

Permalink
deps: update undici to 5.26.4
Browse files Browse the repository at this point in the history
PR-URL: #50274
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
nodejs-github-bot authored and targos committed Oct 25, 2023
1 parent a0e60c1 commit 7ccb478
Show file tree
Hide file tree
Showing 10 changed files with 15,484 additions and 116 deletions.
2 changes: 1 addition & 1 deletion deps/undici/src/docs/api/DispatchInterceptor.md
@@ -1,4 +1,4 @@
#Interface: DispatchInterceptor
# Interface: DispatchInterceptor

Extends: `Function`

Expand Down
10 changes: 9 additions & 1 deletion deps/undici/src/lib/api/api-stream.js
Expand Up @@ -104,6 +104,10 @@ class StreamHandler extends AsyncResource {
{ callback, body: res, contentType, statusCode, statusMessage, headers }
)
} else {
if (factory === null) {
return
}

res = this.runInAsyncScope(factory, null, {
statusCode,
headers,
Expand Down Expand Up @@ -152,14 +156,18 @@ class StreamHandler extends AsyncResource {
onData (chunk) {
const { res } = this

return res.write(chunk)
return res ? res.write(chunk) : true
}

onComplete (trailers) {
const { res } = this

removeSignal(this)

if (!res) {
return
}

this.trailers = util.parseHeaders(trailers)

res.end()
Expand Down
2 changes: 1 addition & 1 deletion deps/undici/src/lib/api/readable.js
Expand Up @@ -265,7 +265,7 @@ function consumeEnd (consume) {
pos += buf.byteLength
}

resolve(dst)
resolve(dst.buffer)
} else if (type === 'blob') {
if (!Blob) {
Blob = require('buffer').Blob
Expand Down
4 changes: 3 additions & 1 deletion deps/undici/src/lib/client.js
Expand Up @@ -1070,7 +1070,9 @@ function onParserTimeout (parser) {

function onSocketReadable () {
const { [kParser]: parser } = this
parser.readMore()
if (parser) {
parser.readMore()
}
}

function onSocketError (err) {
Expand Down

0 comments on commit 7ccb478

Please sign in to comment.