build: update distribution (#183)
Co-authored-by: actions-bot <actions-bot@users.noreply.github.com>
This commit is contained in:
5
dist/index.js
vendored
5
dist/index.js
vendored
@@ -3977,8 +3977,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|||||||
|
|
||||||
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
||||||
response.once('close', function (hadError) {
|
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
|
// 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) {
|
if (hasDataListener && !hadError) {
|
||||||
const err = new Error('Premature close');
|
const err = new Error('Premature close');
|
||||||
|
|||||||
Reference in New Issue
Block a user