From 52cbbbd63cafb6c4d8aabe8ba1451d82fb577fb8 Mon Sep 17 00:00:00 2001 From: Sebastian Raff Date: Fri, 18 Jan 2019 18:03:26 +0100 Subject: [PATCH] Use relative paths in httpAdmin requests Absolute paths anticipate the usage of the Node-RED `httpRoot` config option, relative should always work. `httpRoot` is often used when Node-RED is behind a reverse Proxy or embedded in another application, like e.g. here: https://github.com/HM-RedMatic/RedMatic/issues/131 --- tradfri-out.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tradfri-out.html b/tradfri-out.html index 3e7945f..3de0b41 100644 --- a/tradfri-out.html +++ b/tradfri-out.html @@ -139,7 +139,7 @@

Details

var c = RED.nodes.node($('#node-input-hub option:selected').val()); // Try to connect to hub to get device and group data - $.get('/tradfri/controls',{sid:c.sid, coap:c.coap, hubip:c.hubip, identity:c.identity, preshared_key:c.preshared_key}, function(data){ + $.get('tradfri/controls',{sid:c.sid, coap:c.coap, hubip:c.hubip, identity:c.identity, preshared_key:c.preshared_key}, function(data){ // Stop spinner $('#tradfri-spinner').removeClass('fa-pulse'); @@ -277,7 +277,7 @@

Details

}; if (vtst(tsid) && vtst(tcoap) && vtst(thubip)){ - $.get('/tradfri/register',{sid: tsid, coap:tcoap, hubip:thubip}, function(data){ + $.get('tradfri/register',{sid: tsid, coap:tcoap, hubip:thubip}, function(data){ if (data.status == 'ok'){ $('#node-config-input-preshared_key').val(data.preshared_key); $('#node-config-input-identity').val(data.identity); @@ -293,7 +293,7 @@

Details

}); - $.get('/tradfri/libs', function(data){ + $.get('tradfri/libs', function(data){ data.forEach(function(item){ var t = $(""+item.file+""); t.on('click', function(){