-rw-r--r-- | ui-atom.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -39,33 +39,34 @@ void add_entry(struct commit *commit, char *host) t++; else t = mail; t2 = strchr(t, '>'); if (t2) *t2 = '\0'; html("<email>"); html_txt(t); html("</email>\n"); free(mail); } html("</author>\n"); html("<published>"); cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time); html("</published>\n"); if (host) { - html("<link rel='alternate' type='text/html' href='http://"); + html("<link rel='alternate' type='text/html' href='"); + html(cgit_httpscheme()); html_attr(host); html_attr(cgit_pageurl(ctx.repo->url, "commit", NULL)); if (ctx.cfg.virtual_root) delim = '?'; htmlf("%cid=%s", delim, hex); html("'/>\n"); } htmlf("<id>%s</id>\n", hex); html("<content type='text'>\n"); html_txt(info->msg); html("</content>\n"); html("<content type='xhtml'>\n"); html("<div xmlns='http://www.w3.org/1999/xhtml'>\n"); html("<pre>\n"); html_txt(info->msg); html("</pre>\n"); @@ -100,30 +101,31 @@ void cgit_print_atom(char *tip, char *path, int max_count) rev.max_count = max_count; setup_revisions(argc, argv, &rev, NULL); prepare_revision_walk(&rev); host = cgit_hosturl(); ctx.page.mimetype = "text/xml"; ctx.page.charset = "utf-8"; cgit_print_http_headers(&ctx); html("<feed xmlns='http://www.w3.org/2005/Atom'>\n"); html("<title>"); html_txt(ctx.repo->name); html("</title>\n"); html("<subtitle>"); html_txt(ctx.repo->desc); html("</subtitle>\n"); if (host) { - html("<link rel='alternate' type='text/html' href='http://"); + html("<link rel='alternate' type='text/html' href='"); + html(cgit_httpscheme()); html_attr(host); html_attr(cgit_repourl(ctx.repo->url)); html("'/>\n"); } while ((commit = get_revision(&rev)) != NULL) { add_entry(commit, host); free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } html("</feed>\n"); } |