Issue #3985 - Testcase for CookieCutter parsing issue of bad cookie

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-08-15 17:58:53 -05:00
parent 50b524bb6b
commit eaf2263053
1 changed files with 14 additions and 0 deletions

View File

@ -245,4 +245,18 @@ public class CookieCutterTest
assertThat("Cookies.length", cookies.length, is(0));
}
@Test
public void testMultipleCookies()
{
String rawCookie = "testcookie; server.id=abcd; server.detail=cfg";
// The first cookie "testcookie" should be ignored, per RFC6265, as it's missing the "=" sign.
Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie);
assertThat("Cookies.length", cookies.length, is(2));
assertCookie("Cookies[0]", cookies[0], "server.id", "abcd", 0, null);
assertCookie("Cookies[1]", cookies[1], "server.detail", "cfg", 0, null);
}
}