Skip to content

Commit

Permalink
fix write after end
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDeveloper committed Apr 10, 2021
1 parent e329455 commit 2f4bd69
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,6 @@ function createConnector(opts = {}) {
// Disables the Nagle algorithm
request.setNoDelay(true)

// starts the request
if (isStream(params.body) === true) {
pump(params.body, request, err => {
/* istanbul ignore if */
if (err != null && cleanedListeners === false) {
cleanListeners()
this._openRequests--
callback(err, null)
}
})
} else {
request.end(params.body)
}

function cleanListeners () {
request.removeListener('response', onResponse)
request.removeListener('timeout', onTimeout)
Expand Down

0 comments on commit 2f4bd69

Please sign in to comment.