From 0f8ade8c6050d61d1a9bf0522ac087eaf41eab14 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 7 Nov 2024 19:42:02 +0100 Subject: Propagate 'last-modified' and 'etag' fields while proxying. But does it work? --- html.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'html.c') diff --git a/html.c b/html.c index 1e09c5e..b5d9148 100644 --- a/html.c +++ b/html.c @@ -2796,7 +2796,8 @@ xs_str *html_notifications(snac *user, int skip, int show) int html_get_handler(const xs_dict *req, const char *q_path, - char **body, int *b_size, char **ctype, xs_str **etag) + char **body, int *b_size, char **ctype, + xs_str **etag, xs_str **last_modified) { const char *accept = xs_dict_get(req, "accept"); int status = HTTP_STATUS_NOT_FOUND; @@ -3227,6 +3228,11 @@ int html_get_handler(const xs_dict *req, const char *q_path, if (valid_status(status)) { const char *ct = xs_dict_get(rsp, "content-type"); + const char *lm = xs_dict_get(rsp, "last-modified"); + const char *et = xs_dict_get(rsp, "etag"); + + if (lm) *last_modified = xs_dup(lm); + if (et) *etag = xs_dup(et); /* find the content-type in the static mime types, and return that value instead of ct, which will -- cgit v1.2.3