Skip to content

Commit

Permalink
Moving response emit above setHeaders on destination streams
Browse files Browse the repository at this point in the history
  • Loading branch information
kenperkins committed Mar 29, 2013
1 parent 9e1a5dc commit 4d63a04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,8 @@ Request.prototype.onResponse = function (response) {
}
}

self.emit('response', response)

self.dests.forEach(function (dest) {
self.pipeDest(dest)
})
Expand All @@ -809,8 +811,6 @@ Request.prototype.onResponse = function (response) {
})
response.on("close", function () {self.emit("close")})

self.emit('response', response)

if (self.callback) {
var buffer = []
var bodyLen = 0
Expand Down

0 comments on commit 4d63a04

Please sign in to comment.