>From 28cfe3d56d2139fc4a50ac9b20b2a73fe12f5a6c Mon Sep 17 00:00:00 2001
From: Roel Janssen <r...@gnu.org>
Date: Tue, 15 Mar 2016 22:45:32 +0100
Subject: [PATCH] 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.
---
 website/static/base/js/packages.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js
index 246d828..12b827f 100644
--- a/website/static/base/js/packages.js
+++ b/website/static/base/js/packages.js
@@ -17,7 +17,7 @@ function set_build_status (pkg_string)
           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);
+      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();
   }
 }
-- 
2.6.3

Hello Ludo,

Here's the patch.

Kind regards,
Roel Janssen

Ludovic Courtès writes:

> Hello!
>
> It took a while, but finally hydra.gnu.org has its own Let’s Encrypt
> certificate and is available over https, woohoo!
>
> Back to the initial problem, we (i.e., you ;-)) can now modify
> packages.js so that it uses either http or https to use Hydra’s API,
> depending on the current URL.
>
> Thoughts?
>
> Ludo’.

Reply via email to