Skip to content

Commit

Permalink
Merge pull request #197 from rneilson/onresponse
Browse files Browse the repository at this point in the history
Add response event to stream on 200 response
  • Loading branch information
desmondmorris committed Dec 11, 2016
2 parents 6f0003f + 16cde0d commit 749b34d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/twitter.js
Expand Up @@ -273,6 +273,10 @@ Twitter.prototype.stream = function(method, params, callback) {
if(response.statusCode !== 200) {
stream.emit('error', new Error('Status Code: ' + response.statusCode));
}
else {
stream.emit('response', response);
}

response.on('data', function(chunk) {
stream.receive(chunk);
});
Expand Down

0 comments on commit 749b34d

Please sign in to comment.