aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-11-07 19:42:02 +0100
committerdefault <nobody@localhost>2024-11-07 19:42:02 +0100
commit0f8ade8c6050d61d1a9bf0522ac087eaf41eab14 (patch)
tree9eff0dbadcf4ca0807fe69f5a1f1ed8cdd20d3f9 /html.c
parent916dc76332b6a780cf3e3cebaab3bec139684f1d (diff)
Propagate 'last-modified' and 'etag' fields while proxying.
But does it work?
Diffstat (limited to 'html.c')
-rw-r--r--html.c8
1 files changed, 7 insertions, 1 deletions
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