Skip to content

Commit

Permalink
workaround for node.js bug nodejs/node#21398
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Hunt committed Sep 6, 2019
1 parent eba325f commit 0fa4b90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ Check handler for HTTP(S)
handlers.http = (target, data, event, resolve, reject) => {
const request = createRequest(target.url, response => {
data.statusCode = response.statusCode
response.once("readable", () => data.timings.readable = hrtime())
response.once("readable", () => {
data.timings.readable = hrtime()
response.on('data', () => { })
})
response.once("end", () => data.timings.end = hrtime())
})
request.setTimeout(1)
Expand Down Expand Up @@ -244,4 +247,5 @@ handlers.smtp = (target, data, event, resolve, reject) => {

socket.connect(target.port, target.hostname, () => {})

}
}

0 comments on commit 0fa4b90

Please sign in to comment.