Skip to content

Commit

Permalink
build: update distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-bot authored Jul 2, 2023
1 parent 05b1c51 commit e60c463
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 e60c463

Please sign in to comment.