commit 77f5b51

Yonle  ·  2023-07-14 04:59:31 +0000 UTC
parent 4ab22b2
html.c: Don't let public get into timeline.html_

Signed-off-by: Yonle <yonle@lecturify.net>
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         }