summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-08-19 09:52:04 +0200
committerdefault <nobody@localhost>2023-08-19 09:52:04 +0200
commit5c7b26bcdcac85433f45e93a934525ecf1e92414 (patch)
tree82d0000c4a17bc8f09e9ec725cd235f1012135f4 /html.c
parent3bdc484206836e33a19321f18847f422a906f050 (diff)
static_get() and history_get() both share the same code.
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/html.c b/html.c
index 19ab6b7..11c1918 100644
--- a/html.c
+++ b/html.c
@@ -1875,7 +1875,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
if (cache && history_mtime(&snac, h) > timeline_mtime(&snac)) {
snac_debug(&snac, 1, xs_fmt("serving cached local timeline"));
- status = history_get(&snac, h, body, b_size, NULL, NULL);
+ status = history_get(&snac, h, body, b_size,
+ xs_dict_get(req, "if-none-match"), etag);
}
else {
xs *list = timeline_list(&snac, "public", skip, show);
@@ -1903,7 +1904,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
if (cache && history_mtime(&snac, "timeline.html_") > timeline_mtime(&snac)) {
snac_debug(&snac, 1, xs_fmt("serving cached timeline"));
- status = history_get(&snac, "timeline.html_", body, b_size, NULL, NULL);
+ status = history_get(&snac, "timeline.html_", body, b_size,
+ xs_dict_get(req, "if-none-match"), etag);
}
else {
snac_debug(&snac, 1, xs_fmt("building timeline"));
@@ -1992,7 +1994,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
status = 404;
}
else
- status = history_get(&snac, id, body, b_size, NULL, NULL);
+ status = history_get(&snac, id, body, b_size,
+ xs_dict_get(req, "if-none-match"), etag);
}
}
else