Fix mg_http_parse_header

Per standard, cookies are delimited by `; `.

CL: Fix mg_http_parse_header: treat ";" as a delimiter.

PUBLISHED_FROM=039243c30f5fabf4a4700a43506f841b3268306a
This commit is contained in:
Deomid Ryabkov
2018-04-10 10:19:36 +00:00
committed by Cesanta Bot
parent b8eca17c55
commit c2fbff6d0e
3 changed files with 10 additions and 7 deletions
+4 -1
View File
@@ -4973,7 +4973,7 @@ static const char *test_buffer_limit(void) {
static const char *test_http_parse_header(void) {
static struct mg_str h = MG_MK_STR(
"xx=1 kl yy, ert=234 kl=123, "
"xx=1 kl yy, ert=234 kl=123, qq=ww;"
"uri=\"/?naii=x,y\";ii=\"12\\\"34\" zz='aa bb',tt=2,gf=\"xx d=1234");
char buf[20];
char *buf2;
@@ -5021,6 +5021,9 @@ static const char *test_http_parse_header(void) {
ASSERT_EQ(mg_http_parse_header(&h, "tt", buf, sizeof(buf)), 1);
ASSERT_STREQ(buf, "2");
ASSERT(mg_http_parse_header(&h, "uri", buf, sizeof(buf)) > 0);
ASSERT_STREQ(buf, "/?naii=x,y");
ASSERT(mg_http_parse_header(&h, "qq", buf, sizeof(buf)) > 0);
ASSERT_STREQ(buf, "ww");
return NULL;
}