diff options
author | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 11:40:25 +0200 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 11:41:06 +0200 |
commit | fbe091a716447be496519ce439451d36d5b9fc24 (patch) | |
tree | c6560c6f2ab6b4760ac6eaecda1759321da2746e /ui-shared.c | |
parent | Return http statuscode 404 on unknown branch (diff) | |
parent | use cgit_httpscheme() for atom feed (diff) | |
download | cgit-pink-fbe091a716447be496519ce439451d36d5b9fc24.tar.gz cgit-pink-fbe091a716447be496519ce439451d36d5b9fc24.zip |
Merge branch 'do/https'
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-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) html("</div>\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("<link rel='alternate' title='Atom feed' href='http://"); + html("<link rel='alternate' title='Atom feed' href='"); + html(cgit_httpscheme()); html_attr(cgit_hosturl()); html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, fmt("h=%s", ctx->qry.head))); |