Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 0c7d2e2

Browse files
committed
node v0.10 does not emit 'aborted' after request.abort()
For v0.10 we need to check `req.timedOut` in `gotEnd()` to know that we aborted, and this is not a complete response.
1 parent 673b564 commit 0c7d2e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/endpoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ module.exports = function (inherits, EventEmitter, Pinger, EndpointError) {
285285

286286
if (req.callback === null) { return }
287287

288+
if (req.timedOut) { return gotAborted.call(this) }
289+
288290
var buffer = new Buffer(this.bodyLength)
289291
var offset = 0
290292
for (var i = 0; i < this.bodyChunks.length; i++) {

0 commit comments

Comments
 (0)