X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a61871a18ffa9fc28e7ab0950415404350c8c857..694dd43886f23723f415aed3afb62131cdbcaa51:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 4f28512..5ce2bc5 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -34,6 +34,17 @@ void cgit_print_error(char *msg) html("\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; @@ -492,7 +503,8 @@ void cgit_print_docstart(struct cgit_context *ctx) html("'/>\n"); } if (host && ctx->repo) { - html("