]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
add cgit_httpscheme() -> http:// or https://
[ps-cgit] / ui-shared.c
index de77bbfadf86dd08e794145395ca1e20e1f63e9c..749ea35c58d5cab7647620d94b570e3501bd9017 100644 (file)
@@ -34,6 +34,17 @@ void cgit_print_error(char *msg)
        html("</div>\n");
 }
 
+char *cgit_httpscheme()
+{
+       char *https;
+
+       https = getenv("HTTPS");
+       if (https != NULL && strcmp(https, "on") == 0)
+               return "https://";
+       else
+               return "http://";
+}
+
 char *cgit_hosturl()
 {
        char *host, *port;