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 richardlau committed Oct 26, 2023
1 parent a60fbf2 commit 61b4afb
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 61b4afb

Please sign in to comment.