diff options
| author | 2024-11-07 19:42:02 +0100 | |
|---|---|---|
| committer | 2024-11-07 19:42:02 +0100 | |
| commit | 0f8ade8c6050d61d1a9bf0522ac087eaf41eab14 (patch) | |
| tree | 9eff0dbadcf4ca0807fe69f5a1f1ed8cdd20d3f9 /html.c | |
| parent | Also use the proxy in replace_shortnames(). (diff) | |
| download | snac2-0f8ade8c6050d61d1a9bf0522ac087eaf41eab14.tar.gz snac2-0f8ade8c6050d61d1a9bf0522ac087eaf41eab14.tar.xz snac2-0f8ade8c6050d61d1a9bf0522ac087eaf41eab14.zip | |
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) | |||
| 2796 | 2796 | ||
| 2797 | 2797 | ||
| 2798 | int html_get_handler(const xs_dict *req, const char *q_path, | 2798 | int html_get_handler(const xs_dict *req, const char *q_path, |
| 2799 | char **body, int *b_size, char **ctype, xs_str **etag) | 2799 | char **body, int *b_size, char **ctype, |
| 2800 | xs_str **etag, xs_str **last_modified) | ||
| 2800 | { | 2801 | { |
| 2801 | const char *accept = xs_dict_get(req, "accept"); | 2802 | const char *accept = xs_dict_get(req, "accept"); |
| 2802 | int status = HTTP_STATUS_NOT_FOUND; | 2803 | int status = HTTP_STATUS_NOT_FOUND; |
| @@ -3227,6 +3228,11 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3227 | 3228 | ||
| 3228 | if (valid_status(status)) { | 3229 | if (valid_status(status)) { |
| 3229 | const char *ct = xs_dict_get(rsp, "content-type"); | 3230 | const char *ct = xs_dict_get(rsp, "content-type"); |
| 3231 | const char *lm = xs_dict_get(rsp, "last-modified"); | ||
| 3232 | const char *et = xs_dict_get(rsp, "etag"); | ||
| 3233 | |||
| 3234 | if (lm) *last_modified = xs_dup(lm); | ||
| 3235 | if (et) *etag = xs_dup(et); | ||
| 3230 | 3236 | ||
| 3231 | /* find the content-type in the static mime types, | 3237 | /* find the content-type in the static mime types, |
| 3232 | and return that value instead of ct, which will | 3238 | and return that value instead of ct, which will |