瀏覽代碼

Added history support.

default 2 年之前
父節點
當前提交
25a057bac2
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      html.c

+ 6 - 0
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;