Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If someone makes a request with garbage, and parsing fails, the CLI t…

…ool would not catch the error and crash. That's not a nice thing to do, so now just destroy the request.
  • Loading branch information...
commit 26412d586cbb5023e6256c2384828bde11886f1a 1 parent 3263b71
@yorickvP yorickvP authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/bouncy.js
View
4 bin/bouncy.js
@@ -20,6 +20,10 @@ bouncy(function (req, bounce) {
route = route[Math.floor(Math.random() * route.length)];
}
+ req.on('error', function(err) {
+ req.destroy();
+ });
+
if (typeof route === 'string') {
var s = route.split(':');
if (s[1]) {
Please sign in to comment.
Something went wrong with that request. Please try again.