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 | |
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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/microhttpd/response.c | 8 |
2 files changed, 10 insertions, 4 deletions
@@ -1,4 +1,8 @@ | |||
1 | Tue May 5 20:57:00 MSK 2017 | 1 | Mon May 8 19:30:00 MSK 2017 |
2 | Fixed: use case-insensitive matching for header name in | ||
3 | MHD_get_response_header(), match only headers (not footers). -EG | ||
4 | |||
5 | Fri May 5 20:57:00 MSK 2017 | ||
2 | Fixed null dereference when connection has "Upgrade" request and | 6 | Fixed null dereference when connection has "Upgrade" request and |
3 | connection is not upgraded. -JB/EG | 7 | connection is not upgraded. -JB/EG |
4 | Better handle Keep-Alive/Close. -EG | 8 | Better handle Keep-Alive/Close. -EG |
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 | ||