diff options
| author | default <nobody@localhost> | 2024-11-07 19:42:02 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-11-07 19:42:02 +0100 |
| commit | 0f8ade8c6050d61d1a9bf0522ac087eaf41eab14 (patch) | |
| tree | 9eff0dbadcf4ca0807fe69f5a1f1ed8cdd20d3f9 /html.c | |
| parent | 916dc76332b6a780cf3e3cebaab3bec139684f1d (diff) | |
Propagate 'last-modified' and 'etag' fields while proxying.
But does it work?
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |