From: Lars Hjemli Date: Sat, 25 Jul 2009 09:40:25 +0000 (+0200) Subject: Merge branch 'do/https' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/fbe091a716447be496519ce439451d36d5b9fc24?hp=-c Merge branch 'do/https' Signed-off-by: Lars Hjemli --- fbe091a716447be496519ce439451d36d5b9fc24 diff --combined ui-shared.c index 2630f23,5ce2bc5..29036d0 --- a/ui-shared.c +++ b/ui-shared.c @@@ -34,6 -34,17 +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; @@@ -456,8 -467,6 +467,8 @@@ void cgit_print_age(time_t t, time_t ma void cgit_print_http_headers(struct cgit_context *ctx) { + if (ctx->page.status) + htmlf("Status: %d %s\n", ctx->page.status, ctx->page.statusmsg); if (ctx->page.mimetype && ctx->page.charset) htmlf("Content-Type: %s; charset=%s\n", ctx->page.mimetype, ctx->page.charset); @@@ -494,7 -503,8 +505,8 @@@ void cgit_print_docstart(struct cgit_co html("'/>\n"); } if (host && ctx->repo) { - html("