Skip to content
Permalink
Browse files

do proper checking for a pass not existing. fixes #671

  • Loading branch information...
jcrugzz committed Jul 17, 2014
1 parent 7104a7c commit 5f838541cb5fb08a6d8cb40a72726afb3ebb3d3b
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/http-proxy/index.js
@@ -143,7 +143,7 @@ ProxyServer.prototype.before = function(type, passName, callback) {
if(v.name === passName) i = idx;
})

if(!i) throw new Error('No such pass');
if(i === false) throw new Error('No such pass');

passes.splice(i, 0, callback);
};
@@ -158,7 +158,7 @@ ProxyServer.prototype.after = function(type, passName, callback) {
if(v.name === passName) i = idx;
})

if(!i) throw new Error('No such pass');
if(i === false) throw new Error('No such pass');

passes.splice(i++, 0, callback);
};

0 comments on commit 5f83854

Please sign in to comment.
You can’t perform that action at this time.