Skip to content

Commit

Permalink
[fix] emit an error if proper URL is not passed in as a target
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Aug 14, 2014
1 parent 63c53a1 commit 37036dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/http-proxy/index.js
Expand Up @@ -64,7 +64,9 @@ function createRightProxy(type) {
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++) {
/**
Expand Down

0 comments on commit 37036dd

Please sign in to comment.