aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-05-08 19:35:13 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-05-09 12:22:50 +0300
commit6894504f51ecd271f7471c69935329b1402f49c2 (patch)
treeede37aba4f769e08a56ae18ab2a6cac8c3c1db26
parent8a88bc9335bc30ba2cf2719d7f26f93267ff7104 (diff)
downloadlibmicrohttpd-6894504f51ecd271f7471c69935329b1402f49c2.tar.gz
libmicrohttpd-6894504f51ecd271f7471c69935329b1402f49c2.zip
Fixed MHD_get_response_header(): used case-insensitive match for header name, use only headers
-rw-r--r--ChangeLog6
-rw-r--r--src/microhttpd/response.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7de19bd1..a8a69d8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
1Tue May 5 20:57:00 MSK 2017 1Mon 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
5Fri 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