Skip to content

Commit

Permalink
Return string rather than Buffer on response
Browse files Browse the repository at this point in the history
In previous versions of Dockerode, this was expected behaviour. 2.5.8 broke this, and now returns a Buffer when the `parseJSON` fails. This PR returns the stringified buffer even when this fails, rather than the Buffer object.
  • Loading branch information
Cherry authored Jan 21, 2019
1 parent a2101bb commit 05b5d35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Modem.prototype.buildRequest = function(options, context, data, callback) {

debug('Received: %s', result);

var json = parseJSON(result) || buffer;
var json = parseJSON(result) || result;
self.buildPayload(null, context.isStream, context.statusCodes, false, req, res, json, callback);
});
}
Expand Down

0 comments on commit 05b5d35

Please sign in to comment.