mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Search by tag returns RSS if the appropriate header is defined.
This commit is contained in:
parent
45357b8e6e
commit
ddd2af73bd
1 changed files with 9 additions and 3 deletions
10
httpd.c
10
httpd.c
|
@ -169,8 +169,6 @@ int server_get_handler(xs_dict *req, const char *q_path,
|
|||
{
|
||||
int status = 0;
|
||||
|
||||
(void)req;
|
||||
|
||||
/* is it the server root? */
|
||||
if (*q_path == '\0') {
|
||||
xs_dict *q_vars = xs_dict_get(req, "q_vars");
|
||||
|
@ -195,6 +193,14 @@ int server_get_handler(xs_dict *req, const char *q_path,
|
|||
more = 1;
|
||||
}
|
||||
|
||||
char *accept = xs_dict_get(req, "accept");
|
||||
if (!xs_is_null(accept) && strcmp(accept, "application/rss+xml") == 0) {
|
||||
xs *link = xs_fmt("%s/?t=%s", srv_baseurl, t);
|
||||
|
||||
*body = timeline_to_rss(NULL, tl, link, link, link);
|
||||
*ctype = "application/rss+xml; charset=utf-8";
|
||||
}
|
||||
else
|
||||
*body = html_timeline(NULL, tl, 0, skip, show, more, t, NULL, 0);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue