diff options
| author | 2023-08-19 12:52:28 +0200 | |
|---|---|---|
| committer | 2023-08-19 12:52:28 +0200 | |
| commit | 26f2c40579d7b28f0c59f16f521008235d02a9be (patch) | |
| tree | 4d49977ac607c61648903d5334928edd1cabd932 /httpd.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-26f2c40579d7b28f0c59f16f521008235d02a9be.tar.gz penes-snac2-26f2c40579d7b28f0c59f16f521008235d02a9be.tar.xz penes-snac2-26f2c40579d7b28f0c59f16f521008235d02a9be.zip | |
The hash 'more_headers' is added to the response HTTP headers.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -285,6 +285,14 @@ void httpd_connection(FILE *f) | |||
| 285 | if (!xs_is_null(etag)) | 285 | if (!xs_is_null(etag)) |
| 286 | headers = xs_dict_append(headers, "etag", etag); | 286 | headers = xs_dict_append(headers, "etag", etag); |
| 287 | 287 | ||
| 288 | /* if there are any additional headers, add them */ | ||
| 289 | xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); | ||
| 290 | if (xs_type(more_headers) == XSTYPE_DICT) { | ||
| 291 | char *k, *v; | ||
| 292 | while (xs_dict_iter(&more_headers, &k, &v)) | ||
| 293 | headers = xs_dict_set(headers, k, v); | ||
| 294 | } | ||
| 295 | |||
| 288 | if (b_size == 0 && body != NULL) | 296 | if (b_size == 0 && body != NULL) |
| 289 | b_size = strlen(body); | 297 | b_size = strlen(body); |
| 290 | 298 | ||