Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Node V0.5.0 has a bug where the 'end' event on an https response obje…

…ct does not fire. We can always safely respond on the 'data' event
  • Loading branch information...
commit 3858f8e6111cae7ad41df3d164cde98e7f96a215 1 parent ac964f9
Dave Hoff harborhoffer authored mheadd committed

Showing 1 changed file with 3 additions and 5 deletions. Show diff stats Hide diff stats

  1. +3 5 lib/smsified.js
8 lib/smsified.js
@@ -94,12 +94,10 @@ SMSified.prototype.makeApiCall = function(method, path, callback) {
94 94 else {
95 95 self.responseBody = "";
96 96 response.setEncoding('utf8');
97   - response.on('data', function(chunk) {
98   - self.responseBody += chunk;
  97 + response.on('data', function(data) {
  98 + console.log(JSON.parse(data))
  99 + callback(JSON.parse(data));
99 100 });
100   - response.on('end', function() {
101   - callback(JSON.parse(self.responseBody));
102   - });
103 101 }
104 102 });
105 103 apiCall.end();

0 comments on commit 3858f8e

Please sign in to comment.
Something went wrong with that request. Please try again.