aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2009-07-25 18:40:25 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2009-07-25 18:41:06 (JST)
commitfbe091a716447be496519ce439451d36d5b9fc24 (patch)
treec6560c6f2ab6b4760ac6eaecda1759321da2746e /ui-shared.c
parente429fb0cca1e8c78da0ec38fe578bafdeec65534 (diff)
parent694dd43886f23723f415aed3afb62131cdbcaa51 (diff)
downloadcgit-fbe091a716447be496519ce439451d36d5b9fc24.zip
cgit-fbe091a716447be496519ce439451d36d5b9fc24.tar.gz
Merge branch 'do/https'
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c14
1 files changed, 13 insertions, 1 deletions
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)
34 html("</div>\n"); 34 html("</div>\n");
35} 35}
36 36
37char *cgit_httpscheme()
38{
39 char *https;
40
41 https = getenv("HTTPS");
42 if (https != NULL && strcmp(https, "on") == 0)
43 return "https://";
44 else
45 return "http://";
46}
47
37char *cgit_hosturl() 48char *cgit_hosturl()
38{ 49{
39 char *host, *port; 50 char *host, *port;
@@ -494,7 +505,8 @@ void cgit_print_docstart(struct cgit_context *ctx)
494 html("'/>\n"); 505 html("'/>\n");
495 } 506 }
496 if (host && ctx->repo) { 507 if (host && ctx->repo) {
497 html("<link rel='alternate' title='Atom feed' href='http://"); 508 html("<link rel='alternate' title='Atom feed' href='");
509 html(cgit_httpscheme());
498 html_attr(cgit_hosturl()); 510 html_attr(cgit_hosturl());
499 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, 511 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path,
500 fmt("h=%s", ctx->qry.head))); 512 fmt("h=%s", ctx->qry.head)));