X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/3ff58ddd51bcbcbc9b7649bad1a39aa98af4b49f..542f6a433034935a1aa895f7ef3273968915a5d1:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 0dafc83..66d5b82 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; @@ -458,6 +469,8 @@ void cgit_print_http_headers(struct cgit_context *ctx) { const char *method = getenv("REQUEST_METHOD"); + 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); @@ -498,12 +511,15 @@ void cgit_print_docstart(struct cgit_context *ctx) html("'/>\n"); } if (host && ctx->repo) { - html(""); + html("' type='application/atom+xml'/>\n"); } + if (ctx->cfg.head_include) + html_include(ctx->cfg.head_include); html("\n"); html("\n"); if (ctx->cfg.header)