commit 7dc42f5

default  ·  2024-11-07 19:21:02 +0000 UTC
parent eb6d3d0
Propagate the caching headers.
1 files changed,  +6, -0
M html.c
M html.c
+6, -0
 1@@ -3221,6 +3221,12 @@ int html_get_handler(const xs_dict *req, const char *q_path,
 2 
 3             hdrs = xs_dict_append(hdrs, "user-agent", USER_AGENT);
 4 
 5+            const char *ims = xs_dict_get(req, "if-modified-since");
 6+            const char *inm = xs_dict_get(req, "if-none-match");
 7+
 8+            if (ims) hdrs = xs_dict_append(hdrs, "if-modified-since", ims);
 9+            if (inm) hdrs = xs_dict_append(hdrs, "if-none-match", inm);
10+
11             xs *rsp = xs_http_request("GET", url, hdrs,
12                         NULL, 0, &status, body, b_size, 0);
13