mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Added httpOnly cookie ResultMatcher
This commit is contained in:
+10
@@ -198,4 +198,14 @@ public class CookieResultMatchers {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert whether the cookie must be httpOnly.
|
||||
*/
|
||||
public ResultMatcher httpOnly(final String name, final boolean httpOnly) {
|
||||
return result -> {
|
||||
Cookie cookie = result.getResponse().getCookie(name);
|
||||
assertEquals("Response cookie httpOnly", httpOnly, cookie.isHttpOnly());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user