build: update distribution (#183)

Co-authored-by: actions-bot <actions-bot@users.noreply.github.com>
This commit is contained in:
actions-bot 2023-07-04 09:44:17 +09:00 committed by GitHub
parent de56f90828
commit 2c2024be8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

5
dist/index.js vendored
View file

@ -3977,8 +3977,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
response.once('close', function (hadError) {
// tests for socket presence, as in some situations the
// the 'socket' event is not triggered for the request
// (happens in deno), avoids `TypeError`
// if a data listener is still present we didn't end cleanly
const hasDataListener = socket.listenerCount('data') > 0;
const hasDataListener = socket && socket.listenerCount('data') > 0;
if (hasDataListener && !hadError) {
const err = new Error('Premature close');