Skip to content

Commit

Permalink
Merge pull request #556 from alevicki/fix/before_and_after
Browse files Browse the repository at this point in the history
Fix before and after type check
  • Loading branch information
yawnt committed Jan 20, 2014
2 parents e936d18 + c5ec183 commit 3e47c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/http-proxy/index.js
Expand Up @@ -129,7 +129,7 @@ ProxyServer.prototype.listen = function(port) {
};

ProxyServer.prototype.before = function(type, passName, callback) {
if (type !== 'ws' || type !== 'web') {
if (type !== 'ws' && type !== 'web') {
throw new Error('type must be `web` or `ws`');
}
var passes = (type === 'ws') ? this.wsPasses : this.webPasses,
Expand All @@ -144,7 +144,7 @@ ProxyServer.prototype.before = function(type, passName, callback) {
passes.splice(i, 0, callback);
};
ProxyServer.prototype.after = function(type, passName, callback) {
if (type !== 'ws' || type !== 'web') {
if (type !== 'ws' && type !== 'web') {
throw new Error('type must be `web` or `ws`');
}
var passes = (type === 'ws') ? this.wsPasses : this.webPasses,
Expand Down

0 comments on commit 3e47c24

Please sign in to comment.