commit 510bd60
Merge pull request 'html.c: Don't let public get into timeline.html_' (#67) from yonle/snac2:master into master Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/67
1 files changed,
+5,
-1
M
html.c
M
html.c
+5,
-1
1@@ -1843,7 +1843,11 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2 xs *l = xs_split(p_path, "/");
3 char *id = xs_list_get(l, 1);
4
5- if ((*body = history_get(&snac, id)) != NULL) {
6+ if (xs_endswith(id, "timeline.html_")) {
7+ // Don't let them in.
8+ *b_size = 0;
9+ status = 404;
10+ } else if ((*body = history_get(&snac, id)) != NULL) {
11 *b_size = strlen(*body);
12 status = 200;
13 }