From c5ec1836b283bd8fd411ef433492186a032f418b Mon Sep 17 00:00:00 2001 From: alevicki Date: Mon, 20 Jan 2014 10:24:53 -0600 Subject: [PATCH] Fix before and after type check --- lib/http-proxy/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js index 3ba09cd47..290569a3e 100644 --- a/lib/http-proxy/index.js +++ b/lib/http-proxy/index.js @@ -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, @@ -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,