mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fix before and after type check
This commit is contained in:
parent
e936d186b6
commit
c5ec1836b2
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user