Fix before and after type check

This commit is contained in:
alevicki 2014-01-20 10:24:53 -06:00
parent e936d186b6
commit c5ec1836b2

View File

@ -129,7 +129,7 @@ ProxyServer.prototype.listen = function(port) {
}; };
ProxyServer.prototype.before = function(type, passName, callback) { 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`'); throw new Error('type must be `web` or `ws`');
} }
var passes = (type === 'ws') ? this.wsPasses : this.webPasses, var passes = (type === 'ws') ? this.wsPasses : this.webPasses,
@ -144,7 +144,7 @@ ProxyServer.prototype.before = function(type, passName, callback) {
passes.splice(i, 0, callback); passes.splice(i, 0, callback);
}; };
ProxyServer.prototype.after = function(type, passName, 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`'); throw new Error('type must be `web` or `ws`');
} }
var passes = (type === 'ws') ? this.wsPasses : this.webPasses, var passes = (type === 'ws') ? this.wsPasses : this.webPasses,