From d1d6992703b805d3e557566462eea2d29426b892 Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Tue, 15 Mar 2016 22:45:32 +0100 Subject: website: packages: Support both http and https requests to hydra.gnu.org. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * website/static/base/js/packages.js (set_build_status): Use the protocol of the current URL. Co-authored-by: Ludovic Courtès --- website/static/base/js/packages.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'website/static') 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(); } } -- cgit v1.2.3