Skip to content

Commit

Permalink
do proper checking for a pass not existing. fixes #671
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Jul 17, 2014
1 parent 7104a7c commit 5f83854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/http-proxy/index.js
Expand Up @@ -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);
};
Expand All @@ -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.