]> WPIA git - gigi.git/commitdiff
upd: use same-protocol-prefixes for static-links
authorFelix Dörre <felix@dogcraft.de>
Mon, 3 Oct 2016 12:02:01 +0000 (14:02 +0200)
committerFelix Dörre <felix@dogcraft.de>
Tue, 4 Oct 2016 15:13:29 +0000 (17:13 +0200)
Change-Id: I0e556b4dde914e0c8eeaccb9c6e5c703225a46ff

src/org/cacert/gigi/Gigi.java

index 7f6b3c18893bcb3ec7851e1739de38fdd7384424..2f4c27dd0f16fba0df323819e6a10d8f5bff7f07 100644 (file)
@@ -315,17 +315,7 @@ public final class Gigi extends HttpServlet {
 
     }
 
 
     }
 
-    private static String staticTemplateVarHttp = "http://" + ServerConstants.getStaticHostNamePort();
-
-    private static String staticTemplateVarHttps = "https://" + ServerConstants.getStaticHostNamePortSecure();
-
-    private static String getStaticTemplateVar(boolean https) {
-        if (https) {
-            return staticTemplateVarHttps;
-        } else {
-            return staticTemplateVarHttp;
-        }
-    }
+    private static String staticTemplateVar = "//" + ServerConstants.getStaticHostNamePort();
 
     @Override
     protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
 
     @Override
     protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
@@ -429,7 +419,7 @@ public final class Gigi extends HttpServlet {
             vars.put(Menu.AUTH_VALUE, currentAuthContext);
             vars.put("menu", rootMenu);
             vars.put("title", lang.getTranslation(p.getTitle()));
             vars.put(Menu.AUTH_VALUE, currentAuthContext);
             vars.put("menu", rootMenu);
             vars.put("title", lang.getTranslation(p.getTitle()));
-            vars.put("static", getStaticTemplateVar(isSecure));
+            vars.put("static", staticTemplateVar);
             vars.put("year", Calendar.getInstance().get(Calendar.YEAR));
             vars.put("content", content);
             if (currentAuthContext != null) {
             vars.put("year", Calendar.getInstance().get(Calendar.YEAR));
             vars.put("content", content);
             if (currentAuthContext != null) {