Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/ui-shared.c b/ui-shared.c index 015c52b..5e03a7a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -34,17 +34,6 @@ 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; @@ -467,13 +456,9 @@ void cgit_print_age(time_t t, time_t max_relative, char *format) void cgit_print_http_headers(struct cgit_context *ctx) { - const char *method = getenv("REQUEST_METHOD"); - if (ctx->cfg.embedded) return; - 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); @@ -486,11 +471,7 @@ void cgit_print_http_headers(struct cgit_context *ctx) ctx->page.filename); htmlf("Last-Modified: %s\n", http_date(ctx->page.modified)); htmlf("Expires: %s\n", http_date(ctx->page.expires)); - if (ctx->page.etag) - htmlf("ETag: \"%s\"\n", ctx->page.etag); html("\n"); - if (method && !strcmp(method, "HEAD")) - exit(0); } void cgit_print_docstart(struct cgit_context *ctx) @@ -517,15 +498,12 @@ void cgit_print_docstart(struct cgit_context *ctx) html("'/>\n"); } if (host && ctx->repo) { - html("<link rel='alternate' title='Atom feed' href='"); - html(cgit_httpscheme()); + html("<link rel='alternate' title='Atom feed' href='http://"); html_attr(cgit_hosturl()); html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, fmt("h=%s", ctx->qry.head))); - html("' type='application/atom+xml'/>\n"); + html("' type='application/atom+xml'/>"); } - if (ctx->cfg.head_include) - html_include(ctx->cfg.head_include); html("</head>\n"); html("<body>\n"); if (ctx->cfg.header) |