Selaa lähdekoodia

html.c: Don't let public get into timeline.html_

Signed-off-by: Yonle <yonle@lecturify.net>
Yonle 3 vuotta sitten
vanhempi
sitoutus
77f5b51126
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      html.c

+ 5 - 1
html.c

@@ -1843,7 +1843,11 @@ int html_get_handler(const xs_dict *req, const char *q_path,
         xs *l    = xs_split(p_path, "/");
         char *id = xs_list_get(l, 1);
 
-        if ((*body = history_get(&snac, id)) != NULL) {
+        if (xs_endswith(id, "timeline.html_")) {
+            // Don't let them in.
+            *b_size = 0;
+            status = 404;
+        } else if ((*body = history_get(&snac, id)) != NULL) {
             *b_size = strlen(*body);
             status  = 200;
         }