1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

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;