Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface Cookie {
String MAX_AGE_ATTR = "max-age";
String SECURE_ATTR = "secure";
String EXPIRES_ATTR = "expires";
String HTTP_ONLY_ATTR = "httpOnly";
String HTTP_ONLY_ATTR = "httponly";

/**
* @since 5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ void testParseCookieWithAttributes3() throws Exception {
Assertions.assertEquals("", cookie.getAttribute("p1"));
}

@Test
void testParseCookieWithHttpOnly() throws Exception {
final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec();

final Header header = new BasicHeader("Set-Cookie", "name = value ; HttpOnly");
final CookieOrigin origin = new CookieOrigin("host", 80, "/path/", true);
final List<Cookie> cookies = cookiespec.parse(header, origin);

Assertions.assertEquals(1, cookies.size());
final Cookie cookie = cookies.get(0);
Assertions.assertTrue(cookie.containsAttribute(Cookie.HTTP_ONLY_ATTR));
}

@Test
void testValidateCookieBasics() throws Exception {
final CommonCookieAttributeHandler h1 = Mockito.mock(CommonCookieAttributeHandler.class);
Expand Down