Commit 54989e81 authored by Alexander Alashkin's avatar Alexander Alashkin Committed by Cesanta Bot

Fix multipart parsing

Close cesanta/mongoose#770

PUBLISHED_FROM=ae55988f1c6ccdff172b8db405adb36c91289d95
parent bf505bb6
...@@ -5635,11 +5635,6 @@ static void mg_http_multipart_begin(struct mg_connection *nc, ...@@ -5635,11 +5635,6 @@ static void mg_http_multipart_begin(struct mg_connection *nc,
char boundary[100]; char boundary[100];
int boundary_len; int boundary_len;
if (nc->listener == NULL) {
/* No streaming for replies now */
goto exit_mp;
}
ct = mg_get_http_header(hm, "Content-Type"); ct = mg_get_http_header(hm, "Content-Type");
if (ct == NULL) { if (ct == NULL) {
/* We need more data - or it isn't multipart mesage */ /* We need more data - or it isn't multipart mesage */
...@@ -6369,8 +6364,8 @@ int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf, ...@@ -6369,8 +6364,8 @@ int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf,
/* Find where variable starts */ /* Find where variable starts */
for (s = hdr->p; s != NULL && s + n < end; s++) { for (s = hdr->p; s != NULL && s + n < end; s++) {
if ((s == hdr->p || s[-1] == ch || s[-1] == ch1) && s[n] == '=' && if ((s == hdr->p || s[-1] == ch || s[-1] == ch1 || s[-1] == ';') &&
!strncmp(s, var_name, n)) s[n] == '=' && !strncmp(s, var_name, n))
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment