From fbe091a716447be496519ce439451d36d5b9fc24 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 25 Jul 2009 09:40:25 +0000 Subject: Merge branch 'do/https' Signed-off-by: Lars Hjemli --- (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 2630f23..29036d0 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; @@ -494,7 +505,8 @@ void cgit_print_docstart(struct cgit_context *ctx) html("'/>\n"); } if (host && ctx->repo) { - html("