Skip to content

Commit

Permalink
Fixed non-200 responses preventing node from exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorMcKay committed Feb 16, 2017
1 parent 7534e78 commit 32e08ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ OPSkinsAPI.prototype._req = function(httpMethod, iface, method, version, input,
err.ray = res.headers['cf-ray'];
}

// Discard the stream
res.on('data', devNull);

callback(err);
return;
}
Expand Down Expand Up @@ -197,10 +200,12 @@ function userAgent() {
return "node/" + process.versions.node + " node-opskins/" + require('./package.json').version;
}

function devNull() { }

require('./interfaces/IInventory.js');
require('./interfaces/IPricing.js');
require('./interfaces/ISales.js');
require('./interfaces/ISupport.js');
require('./interfaces/ITest.js');
require('./interfaces/IUser.js');
require('./interfaces/IStatus.js');
require('./interfaces/IStatus.js');

0 comments on commit 32e08ae

Please sign in to comment.