Issue #3985 - Fixing RequestTest

+ Moving overly bad cookie to CookieCutter_LenientTest
+ Changing expectation in RequestTest.testCookie()

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-08-16 15:57:26 -05:00
parent fba010d33d
commit 1254f6eb67
2 changed files with 2 additions and 3 deletions

View File

@ -130,6 +130,7 @@ public class CookieCutter_LenientTest
Arguments.of("foo=\"bar;baz\"", "foo", "bar;baz"),
Arguments.of("z=a;b,c:d;e/f[g]", "z", "a"),
Arguments.of("z=\"a;b,c:d;e/f[g]\"", "z", "a;b,c:d;e/f[g]"),
Arguments.of("name=quoted=\"\\\"badly\\\"\"", null, null), // someone attempting to escape a DQUOTE from within a DQUOTED pair)
// Quoted with other Cookie keywords
Arguments.of("x=\"$Version=0\"", "x", "$Version=0"),

View File

@ -1515,9 +1515,7 @@ public class RequestTest
"\n"
);
assertTrue(response.startsWith("HTTP/1.1 200 OK"));
assertEquals(1, cookies.size());
assertEquals("name", cookies.get(0).getName());
assertEquals("quoted=\"\\\"badly\\\"\"", cookies.get(0).getValue());
assertEquals(0, cookies.size()); // this is an invalid cookie
cookies.clear();
response = _connector.getResponse(