HTTP Request - handle null url

Fixes #632
This commit is contained in:
Nick O'Leary 2015-04-26 08:50:42 +01:00
parent c016b102eb
commit 771342989e
1 changed files with 4 additions and 0 deletions

View File

@ -184,6 +184,10 @@ module.exports = function(RED) {
if (isTemplatedUrl) {
url = mustache.render(nodeUrl,msg);
}
if (!url) {
node.error("No url specified",msg);
return;
}
// url must start http:// or https:// so assume http:// if not set
if (!((url.indexOf("http://")===0) || (url.indexOf("https://")===0))) {
url = "http://"+url;