commit 6894504f51ecd271f7471c69935329b1402f49c2
parent 8a88bc9335bc30ba2cf2719d7f26f93267ff7104
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 8 May 2017 19:35:13 +0300
Fixed MHD_get_response_header(): used case-insensitive match for header name, use only headers
Diffstat:
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,4 +1,8 @@
-Tue May 5 20:57:00 MSK 2017
+Mon May 8 19:30:00 MSK 2017
+ Fixed: use case-insensitive matching for header name in
+ MHD_get_response_header(), match only headers (not footers). -EG
+
+Fri May 5 20:57:00 MSK 2017
Fixed null dereference when connection has "Upgrade" request and
connection is not upgraded. -JB/EG
Better handle Keep-Alive/Close. -EG
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
@@ -240,9 +240,11 @@ MHD_get_response_header (struct MHD_Response *response,
if (NULL == key)
return NULL;
for (pos = response->first_header; NULL != pos; pos = pos->next)
- if (0 == strcmp (key,
- pos->header))
- return pos->value;
+ {
+ if ( (pos->kind == MHD_HEADER_KIND) &&
+ MHD_str_equal_caseless_ (pos->header, key) )
+ return pos->value;
+ }
return NULL;
}