Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

provisioning no longer emits "end" and instead accumulates response d…

…ata and only emits responseBody once
  • Loading branch information...
commit bba14a7896919b7219bffbe24bd0548418717808 1 parent 8d5fcb2
@jharlap jharlap authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/tropo-provisioning.js
View
7 lib/tropo-provisioning.js
@@ -91,13 +91,14 @@ TropoProvision.prototype.makeApiCall = function(method, host, path, payload) {
};
var request = https.request(requestOptions, function(response) {
// Process the response.
+ var data = '';
self.emit('responseCode', response.statusCode);
response.setEncoding('utf8');
- response.on('data', function(data) {
- self.emit('responseBody', data.toString());
+ response.on('data', function(chunk) {
+ data = data + chunk;
});
response.on('end', function() {
- self.emit('end');
+ self.emit('responseBody', data);
});
});
if(payload) {
Please sign in to comment.
Something went wrong with that request. Please try again.