guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: website: packages: Support both http and https requests to hydra.


From: Ludovic Courtès
Subject: 01/01: website: packages: Support both http and https requests to hydra.gnu.org.
Date: Tue, 15 Mar 2016 22:00:34 +0000

civodul pushed a commit to branch master
in repository guix-artwork.

commit d1d6992703b805d3e557566462eea2d29426b892
Author: Roel Janssen <address@hidden>
Date:   Tue Mar 15 22:45:32 2016 +0100

    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 <address@hidden>
---
 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();
   }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]