diff options
-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 | ||