diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-05-08 19:35:13 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-05-09 12:22:50 +0300 |
commit | 6894504f51ecd271f7471c69935329b1402f49c2 (patch) | |
tree | ede37aba4f769e08a56ae18ab2a6cac8c3c1db26 /src/microhttpd/response.c | |
parent | 8a88bc9335bc30ba2cf2719d7f26f93267ff7104 (diff) | |
download | libmicrohttpd-6894504f51ecd271f7471c69935329b1402f49c2.tar.gz libmicrohttpd-6894504f51ecd271f7471c69935329b1402f49c2.zip |
Fixed MHD_get_response_header(): used case-insensitive match for header name, use only headers
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index a86e58fc..50ec521e 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -240,9 +240,11 @@ MHD_get_response_header (struct MHD_Response *response, | |||
240 | if (NULL == key) | 240 | if (NULL == key) |
241 | return NULL; | 241 | return NULL; |
242 | for (pos = response->first_header; NULL != pos; pos = pos->next) | 242 | for (pos = response->first_header; NULL != pos; pos = pos->next) |
243 | if (0 == strcmp (key, | 243 | { |
244 | pos->header)) | 244 | if ( (pos->kind == MHD_HEADER_KIND) && |
245 | return pos->value; | 245 | MHD_str_equal_caseless_ (pos->header, key) ) |
246 | return pos->value; | ||
247 | } | ||
246 | return NULL; | 248 | return NULL; |
247 | } | 249 | } |
248 | 250 | ||