diff options
author | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 18:40:25 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 18:41:06 (JST) |
commit | fbe091a716447be496519ce439451d36d5b9fc24 (patch) | |
tree | c6560c6f2ab6b4760ac6eaecda1759321da2746e /ui-shared.c | |
parent | e429fb0cca1e8c78da0ec38fe578bafdeec65534 (diff) | |
parent | 694dd43886f23723f415aed3afb62131cdbcaa51 (diff) | |
download | cgit-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.c | 14 |
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 | ||
37 | char *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 | |||
37 | char *cgit_hosturl() | 48 | char *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))); |