mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Added history support.
This commit is contained in:
parent
aaca6350ed
commit
25a057bac2
1 changed files with 6 additions and 0 deletions
6
html.c
6
html.c
|
@ -851,6 +851,12 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
|
|||
else
|
||||
if (xs_startswith(p_path, "h/")) {
|
||||
/* an entry from the history */
|
||||
xs *id = xs_replace(p_path, "h/", "");
|
||||
|
||||
if ((*body = history_get(&snac, id)) != NULL) {
|
||||
*b_size = strlen(*body);
|
||||
status = 200;
|
||||
}
|
||||
}
|
||||
else
|
||||
status = 404;
|
||||
|
|
Loading…
Reference in a new issue