Fix MockHttpServletRequest.setCookies to produce single cookie header
Prior to this commit, MockHttpServletRequest.setCookies() produced one Cookie header per supplied cookie, resulting in multiple Cookie headers which violates the specification. This commit fixes this by ensuring that all cookie name-value pairs are stored under a single Cookie header, separated by a semicolon. Closes gh-23074
This commit is contained in:
committed by
Sam Brannen
parent
49e5c4dcf6
commit
2ed81be831
@@ -292,7 +292,9 @@ public class MockHttpServletRequestTests {
|
||||
assertEquals("bar", cookies[0].getValue());
|
||||
assertEquals("baz", cookies[1].getName());
|
||||
assertEquals("qux", cookies[1].getValue());
|
||||
assertEquals(Arrays.asList("foo=bar", "baz=qux"), cookieHeaders);
|
||||
|
||||
assertEquals(1, cookieHeaders.size());
|
||||
assertEquals("foo=bar; baz=qux", cookieHeaders.get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user