diff options
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -278,6 +278,7 @@ void httpd_connection(FILE *f) | |||
| 278 | xs *q_path = NULL; | 278 | xs *q_path = NULL; |
| 279 | xs *payload = NULL; | 279 | xs *payload = NULL; |
| 280 | xs *etag = NULL; | 280 | xs *etag = NULL; |
| 281 | xs *last_modified = NULL; | ||
| 281 | int p_size = 0; | 282 | int p_size = 0; |
| 282 | const char *p; | 283 | const char *p; |
| 283 | int fcgi_id; | 284 | int fcgi_id; |
| @@ -329,7 +330,7 @@ void httpd_connection(FILE *f) | |||
| 329 | #endif /* NO_MASTODON_API */ | 330 | #endif /* NO_MASTODON_API */ |
| 330 | 331 | ||
| 331 | if (status == 0) | 332 | if (status == 0) |
| 332 | status = html_get_handler(req, q_path, &body, &b_size, &ctype, &etag); | 333 | status = html_get_handler(req, q_path, &body, &b_size, &ctype, &etag, &last_modified); |
| 333 | } | 334 | } |
| 334 | else | 335 | else |
| 335 | if (strcmp(method, "POST") == 0) { | 336 | if (strcmp(method, "POST") == 0) { |
| @@ -423,6 +424,8 @@ void httpd_connection(FILE *f) | |||
| 423 | 424 | ||
| 424 | if (!xs_is_null(etag)) | 425 | if (!xs_is_null(etag)) |
| 425 | headers = xs_dict_append(headers, "etag", etag); | 426 | headers = xs_dict_append(headers, "etag", etag); |
| 427 | if (!xs_is_null(last_modified)) | ||
| 428 | headers = xs_dict_append(headers, "last-modified", last_modified); | ||
| 426 | 429 | ||
| 427 | /* if there are any additional headers, add them */ | 430 | /* if there are any additional headers, add them */ |
| 428 | const xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); | 431 | const xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); |