mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
MHD_request_get_value(): use case-insensitive match
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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) ?
|
||||
|
||||
Reference in New Issue
Block a user