From 9112b5db051c595894b2a3c26665f4228c5e32bb Mon Sep 17 00:00:00 2001 From: l_samenv Date: Wed, 4 Sep 2024 10:59:30 +0200 Subject: [PATCH] encodeURIComponent for userconfiguration --- client/jsFiles/SEAWebClientCommunication.js | 2 +- client/jsFiles/SEAWebClientGraphics.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/jsFiles/SEAWebClientCommunication.js b/client/jsFiles/SEAWebClientCommunication.js index 69f5a5c..14b8a98 100644 --- a/client/jsFiles/SEAWebClientCommunication.js +++ b/client/jsFiles/SEAWebClientCommunication.js @@ -350,7 +350,7 @@ function successHandler(s, message) { begin = timeRange[0] - timeRange[1]; select.value = begin; // Server-request for variable-list.*/ - reqJSON(0, "http://" + hostPort + "/getvars?time=" + timeRange + "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage()) + "&id=" + reqJSON(0, "http://" + hostPort + "/getvars?time=" + timeRange + "&userconfiguration=" + encodeURIComponent(JSON.stringify(getFormattedUserConfigurationFromLocalStorage())) + "&id=" + clientID, successHandler, errorHandler); break; // Response to a "getvars"-server-request. diff --git a/client/jsFiles/SEAWebClientGraphics.js b/client/jsFiles/SEAWebClientGraphics.js index c2eb376..0c1c388 100644 --- a/client/jsFiles/SEAWebClientGraphics.js +++ b/client/jsFiles/SEAWebClientGraphics.js @@ -831,7 +831,7 @@ let graphs = (function (){ msRightTimestampGetVars = dateTimestampMs + timeValueMs; msRightTimestampGetGraph = dateTimestampMs + 24*60*60*1000; - AJAX("http://" + hostPort + "/getvars?time=" + msLeftTimestampGetVars/1000 + "," + msRightTimestampGetVars/1000 + "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage()) + "&id="+ clientID).getJSON().then(function(data){ + AJAX("http://" + hostPort + "/getvars?time=" + msLeftTimestampGetVars/1000 + "," + msRightTimestampGetVars/1000 + "&userconfiguration=" + encodeURIComponent(JSON.stringify(getFormattedUserConfigurationFromLocalStorage())) + "&id="+ clientID).getJSON().then(function(data){ blocks = data.blocks; document.getElementById("device").innerHTML = data.device maxTime = msRightTimestampGetGraph; @@ -901,7 +901,7 @@ let graphs = (function (){ let msLeftTimestamp = msRightTimestamp - 30*60*1000; cursorLine(null); - AJAX("http://" + hostPort + "/getvars?time=" + msLeftTimestamp/1000 + "," + msRightTimestamp/1000 + "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage()) + "&id="+ clientID).getJSON().then(function(data){ + AJAX("http://" + hostPort + "/getvars?time=" + msLeftTimestamp/1000 + "," + msRightTimestamp/1000 + "&userconfiguration=" + encodeURIComponent(JSON.stringify(getFormattedUserConfigurationFromLocalStorage())) + "&id="+ clientID).getJSON().then(function(data){ currentMaxTime = msRightTimestamp + 60000; currentMinTime = msLeftTimestamp; @@ -1212,7 +1212,7 @@ let graphs = (function (){ function applySettingsCallback(userConfiguration){ cursorLine(null); - AJAX("http://" + hostPort + "/getvars?time=" + currentMinTime/1000 + "," + currentMaxTime/1000 + "&userconfiguration=" + JSON.stringify(userConfiguration) + "&id="+ clientID).getJSON().then(function(data){ + AJAX("http://" + hostPort + "/getvars?time=" + currentMinTime/1000 + "," + currentMaxTime/1000 + "&userconfiguration=" + encodeURIComponent(JSON.stringify(userConfiguration)) + "&id="+ clientID).getJSON().then(function(data){ blocks = data.blocks; document.getElementById("device").innerHTML = data.device maxTime = currentMaxTime;