diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-26 08:59:34 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-26 08:59:34 -0400 |
commit | c2feb3e1ad3149ff394cddd80c93e9cceceda8e9 (patch) | |
tree | 41a40722230d170da17a81617d36ec73b8e4f312 /src/mod_expire.c | |
parent | 885d956edbb066c600b5aa2ee386447c6f2009db (diff) | |
download | lighttpd-git-c2feb3e1ad3149ff394cddd80c93e9cceceda8e9.tar.gz |
[mod_expire] check for default if mime not found
check for default caching if mime-type not found in expire.mimetypes
Diffstat (limited to 'src/mod_expire.c')
-rw-r--r-- | src/mod_expire.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mod_expire.c b/src/mod_expire.c index a2fd0c40..1388d1dc 100644 --- a/src/mod_expire.c +++ b/src/mod_expire.c @@ -267,10 +267,15 @@ REQUEST_FUNC(mod_expire_handler) { if (NULL == ds) { if (NULL == p->conf.expire_mimetypes) return HANDLER_GO_ON; vb = http_header_response_get(r, HTTP_HEADER_CONTENT_TYPE, CONST_STR_LEN("Content-Type")); - ds = (NULL != vb) - ? (const data_string *)array_match_key_prefix(p->conf.expire_mimetypes, vb) - : (const data_string *)array_get_element_klen(p->conf.expire_mimetypes, CONST_STR_LEN("")); - if (NULL == ds) return HANDLER_GO_ON; + if (NULL != vb) + ds = (const data_string *) + array_match_key_prefix(p->conf.expire_mimetypes, vb); + if (NULL == ds) { + ds = (const data_string *) + array_get_element_klen(p->conf.expire_mimetypes, + CONST_STR_LEN("")); + if (NULL == ds) return HANDLER_GO_ON; + } } const time_t * const off = p->toffsets + ds->value.used; |