Commit ad5c62c2 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Rafael Monnerat

[slapos_jio] authorize to load https JSON in http page

/reviewed-on nexedi/slapos.core!114
parent 727782f1
......@@ -7,10 +7,8 @@
function getJSON(url) {
var protocol = URI(url).protocol();
if (protocol === "http" || protocol === "https") {
if (URI(window.location).protocol() !== protocol) {
throw new Error("You cannot mixed http and https calls");
}
if (protocol === "http" && URI(window.location).protocol() == "https") {
throw new Error("You cannot load http JSON in https page");
}
return RSVP.Queue()
.push(function () {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.50940.46169.22476</string> </value>
<value> <string>975.40310.53592.2542</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1542815972.88</float>
<float>1558534002.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -877,6 +877,7 @@
.fail(function (error) {
var parameter_xml = '';
console.warn(error);
console.log(error.stack);
if (gadget.options.value.parameter.parameter_hash !== undefined) {
parameter_xml = atob(gadget.options.value.parameter.parameter_hash);
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.50926.27080.61815</string> </value>
<value> <string>975.40310.53592.2542</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1542815548.03</float>
<float>1558534050.09</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment