Skip to content

Commit

Permalink
build: update distribution (#183)
Browse files Browse the repository at this point in the history
Co-authored-by: actions-bot <actions-bot@users.noreply.github.com>
  • Loading branch information
actions-bot and actions-bot committed Jul 4, 2023
1 parent de56f90 commit 2c2024b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 2c2024b

Please sign in to comment.