summaryrefslogtreecommitdiff
path: root/src/mod_expire.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-12-07 19:15:55 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-07-08 19:54:28 -0400
commit03b4c993d206221b02cda31e9d25cf2b4bc0813e (patch)
tree216e0821e67ea43926cad8ceb401a51ae08c9849 /src/mod_expire.c
parent81c9d0acf100d8e89d8d688d29beb1e5bb8d873a (diff)
downloadlighttpd-git-03b4c993d206221b02cda31e9d25cf2b4bc0813e.tar.gz
[multiple] generic config array type checking
Diffstat (limited to 'src/mod_expire.c')
-rw-r--r--src/mod_expire.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/mod_expire.c b/src/mod_expire.c
index 3a0ed29e..c80cc81b 100644
--- a/src/mod_expire.c
+++ b/src/mod_expire.c
@@ -195,10 +195,10 @@ static void mod_expire_patch_config(connection * const con, plugin_data * const
SETDEFAULTS_FUNC(mod_expire_set_defaults) {
static const config_plugin_keys_t cpk[] = {
{ CONST_STR_LEN("expire.url"),
- T_CONFIG_ARRAY,
+ T_CONFIG_ARRAY_KVSTRING,
T_CONFIG_SCOPE_CONNECTION }
,{ CONST_STR_LEN("expire.mimetypes"),
- T_CONFIG_ARRAY,
+ T_CONFIG_ARRAY_KVSTRING,
T_CONFIG_SCOPE_CONNECTION }
,{ NULL, 0,
T_CONFIG_UNSET,
@@ -217,23 +217,9 @@ SETDEFAULTS_FUNC(mod_expire_set_defaults) {
const array *a = NULL;
switch (cpv->k_id) {
case 0: /* expire.url */
- if (!array_is_kvstring(cpv->v.a)) {
- log_error(srv->errh, __FILE__, __LINE__,
- "unexpected value for %s; "
- "expected list of \"urlpath\" => \"expiration\"",
- cpk[cpv->k_id].k);
- return HANDLER_ERROR;
- }
a = cpv->v.a;
break;
case 1: /* expire.mimetypes */
- if (!array_is_kvstring(cpv->v.a)) {
- log_error(srv->errh, __FILE__, __LINE__,
- "unexpected value for %s; "
- "expected list of \"mimetype\" => \"expiration\"",
- cpk[cpv->k_id].k);
- return HANDLER_ERROR;
- }
for (uint32_t k = 0; k < cpv->v.a->used; ++k) {
data_string *ds = (data_string *)cpv->v.a->data[k];
/*(omit trailing '*', if present, from prefix match)*/