diff options
author | Roel Janssen <roel@gnu.org> | 2016-03-15 22:45:32 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-03-15 22:54:22 +0100 |
commit | d1d6992703b805d3e557566462eea2d29426b892 (patch) | |
tree | c2bf8898c3e15f06f03f88d999e8a66fd672180e | |
parent | f87e09266e67368fa35b68dbc9d04201cc7a8bc2 (diff) | |
download | guix-artwork-d1d6992703b805d3e557566462eea2d29426b892.tar guix-artwork-d1d6992703b805d3e557566462eea2d29426b892.tar.gz |
website: packages: Support both http and https requests to hydra.gnu.org.
* website/static/base/js/packages.js (set_build_status): Use the
protocol of the current URL.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | website/static/base/js/packages.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js index 246d828..d5a125d 100644 --- a/website/static/base/js/packages.js +++ b/website/static/base/js/packages.js @@ -16,8 +16,14 @@ function set_build_status (pkg_string) var pkgInfo = JSON.parse(xhttp.responseText); pkgIcon.src = "../static/base/img/status-icons/"+ pkgInfo[0]["buildstatus"] + ".png"; } - } - xhttp.open("GET", "http://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job="+ pkg_string, true); + }; + + /* Make the request using the same scheme as the current URL to + avoid "mixed content" errors (making an HTTP request from an + HTTPS page.) */ + xhttp.open("GET", window.location.href.split(":")[0] + + "://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job=" + + pkg_string, true); xhttp.send(); } } |