diff --git a/lib/dnsmadeeasy/core.js b/lib/dnsmadeeasy/core.js index d425a36..4376520 100644 --- a/lib/dnsmadeeasy/core.js +++ b/lib/dnsmadeeasy/core.js @@ -104,7 +104,7 @@ _.extend(Client.prototype, { if (err) { return reject(err); } - resolve(JSON.parse(body)); + resolve((body && body.length > 0) ? JSON.parse(body) : body); }); }); }, diff --git a/lib/dnsmadeeasy/managedDns.spec.js b/lib/dnsmadeeasy/managedDns.spec.js index 433e8c0..c6ff936 100644 --- a/lib/dnsmadeeasy/managedDns.spec.js +++ b/lib/dnsmadeeasy/managedDns.spec.js @@ -408,16 +408,12 @@ describe('ManagedDns', function() { reqheaders: headers }) .post('/dns/managed/1/records') - .reply(200, { - status: 'ok' - }); + .reply(200); var managedDns = ManagedDns.createManagedDNS(client); var response = yield managedDns.createRecordForDomain(1, {}); - expect(response).to.be.eql({ - status: 'ok' - }); + expect(response).to.be.equal(''); }); });