mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] emit an error if proper URL is not passed in as a target
This commit is contained in:
parent
63c53a1772
commit
37036dd325
@ -64,7 +64,9 @@ function createRightProxy(type) {
|
|||||||
options[e] = parse_url(options[e]);
|
options[e] = parse_url(options[e]);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(typeof this.emit === 'undefined' && !cbl) { throw new Error("You need to pass a callback to handle errors") }
|
if (!options.target && !options.forward) {
|
||||||
|
return this.emit('error', new Error('Must provide a proper URL as target'));
|
||||||
|
}
|
||||||
|
|
||||||
for(var i=0; i < passes.length; i++) {
|
for(var i=0; i < passes.length; i++) {
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user