diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h index 8dd720f1..ea118da4 100644 --- a/src/include/microhttpd2.h +++ b/src/include/microhttpd2.h @@ -5244,8 +5244,8 @@ MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4,3); * * @param request request to get values from * @param kind what kind of value are we looking for - * @param key the header to look for, empty to lookup 'trailing' value - * without a key + * @param key the name of the value looking for (used for case-insensetive + match), empty to lookup 'trailing' value without a key * @return NULL if no such item was found * @ingroup request */ diff --git a/src/include/microhttpd2_main.h.in b/src/include/microhttpd2_main.h.in index c94cb51a..527cdba1 100644 --- a/src/include/microhttpd2_main.h.in +++ b/src/include/microhttpd2_main.h.in @@ -685,8 +685,8 @@ MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4,3); * * @param request request to get values from * @param kind what kind of value are we looking for - * @param key the header to look for, empty to lookup 'trailing' value - * without a key + * @param key the name of the value looking for (used for case-insensetive + match), empty to lookup 'trailing' value without a key * @return NULL if no such item was found * @ingroup request */ diff --git a/src/mhd2/request_get_value.c b/src/mhd2/request_get_value.c index 024ac94d..158094aa 100644 --- a/src/mhd2/request_get_value.c +++ b/src/mhd2/request_get_value.c @@ -61,7 +61,9 @@ mhd_request_get_value_n (struct MHD_Request *restrict request, { if ((key_len == f->field.nv.name.len) && (0 != (kind & f->field.kind)) && - (0 == memcmp (key, f->field.nv.name.cstr, key_len))) + (0 == mhd_str_equal_caseless_bin_n (key, + f->field.nv.name.cstr, + key_len))) return &(f->field.nv.value); } } @@ -75,7 +77,9 @@ mhd_request_get_value_n (struct MHD_Request *restrict request, f = mhd_DLINKEDL_GET_NEXT (f, post_fields)) { if ((key_len == f->field.name.len) && - (0 == memcmp (key, buf + f->field.name.pos, key_len))) + (0 == mhd_str_equal_caseless_bin_n (key, + buf + f->field.name.pos, + key_len))) { f->field_for_app.value.cstr = (0 == f->field.value.pos) ?