mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Update MockCookie#parse(String) validation to align with Javadoc
See gh-37134 Closes gh-37136 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
+1
-1
@@ -132,7 +132,7 @@ public class MockCookie extends Cookie {
|
||||
* @return the created cookie
|
||||
*/
|
||||
public static MockCookie parse(String setCookieHeader) {
|
||||
Assert.notNull(setCookieHeader, "Set-Cookie header must not be null");
|
||||
Assert.hasText(setCookieHeader, "Set-Cookie header must not be null or empty");
|
||||
String[] cookieParts = setCookieHeader.split("\\s*=\\s*", 2);
|
||||
Assert.isTrue(cookieParts.length == 2, () -> "Invalid Set-Cookie header '" + setCookieHeader + "'");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user