Skip to content

Commit c5ec183

Browse files
committed
Fix before and after type check
1 parent e936d18 commit c5ec183

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/http-proxy/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ ProxyServer.prototype.listen = function(port) {
129129
};
130130

131131
ProxyServer.prototype.before = function(type, passName, callback) {
132-
if (type !== 'ws' || type !== 'web') {
132+
if (type !== 'ws' && type !== 'web') {
133133
throw new Error('type must be `web` or `ws`');
134134
}
135135
var passes = (type === 'ws') ? this.wsPasses : this.webPasses,
@@ -144,7 +144,7 @@ ProxyServer.prototype.before = function(type, passName, callback) {
144144
passes.splice(i, 0, callback);
145145
};
146146
ProxyServer.prototype.after = function(type, passName, callback) {
147-
if (type !== 'ws' || type !== 'web') {
147+
if (type !== 'ws' && type !== 'web') {
148148
throw new Error('type must be `web` or `ws`');
149149
}
150150
var passes = (type === 'ws') ? this.wsPasses : this.webPasses,

0 commit comments

Comments
 (0)