]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
add cgit_httpscheme() -> http:// or https://
[ps-cgit] / ui-shared.c
index 4f2851273418dc9a81c4af942660e4923a149f5e..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;
@@ -500,6 +511,8 @@ void cgit_print_docstart(struct cgit_context *ctx)
        }
        html("</head>\n");
        html("<body>\n");
+       if (ctx->cfg.header)
+               html_include(ctx->cfg.header);
 }
 
 void cgit_print_docend()