Skip to content

Commit 02b914d

Browse files
committed
Merge pull request #246 from tellnes/proxy-remove
Implement RoutingProxy.prototype.remove
2 parents f28c62c + 0532995 commit 02b914d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/node-http-proxy/routing-proxy.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ RoutingProxy.prototype.add = function (options) {
120120
// for the specified `options.host` and `options.port` (if they exist).
121121
//
122122
RoutingProxy.prototype.remove = function (options) {
123-
var key = this._getKey(options);
123+
var key = this._getKey(options),
124+
proxy = this.proxies[key];
125+
126+
delete this.proxies[key];
127+
return proxy;
124128
};
125129

126130
//

0 commit comments

Comments
 (0)