diff options
| author | 2022-10-02 18:22:15 +0200 | |
|---|---|---|
| committer | 2022-10-02 18:22:15 +0200 | |
| commit | 25a057bac27fc612ced9764f3b1610b3fbc6f220 (patch) | |
| tree | fb8f5a49da3071bc4f0a3b008c0fae96a9281a41 /html.c | |
| parent | Updated TODO. (diff) | |
| download | snac2-25a057bac27fc612ced9764f3b1610b3fbc6f220.tar.gz snac2-25a057bac27fc612ced9764f3b1610b3fbc6f220.tar.xz snac2-25a057bac27fc612ced9764f3b1610b3fbc6f220.zip | |
Added history support.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -851,6 +851,12 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * | |||
| 851 | else | 851 | else |
| 852 | if (xs_startswith(p_path, "h/")) { | 852 | if (xs_startswith(p_path, "h/")) { |
| 853 | /* an entry from the history */ | 853 | /* an entry from the history */ |
| 854 | xs *id = xs_replace(p_path, "h/", ""); | ||
| 855 | |||
| 856 | if ((*body = history_get(&snac, id)) != NULL) { | ||
| 857 | *b_size = strlen(*body); | ||
| 858 | status = 200; | ||
| 859 | } | ||
| 854 | } | 860 | } |
| 855 | else | 861 | else |
| 856 | status = 404; | 862 | status = 404; |