Skip to content
Closed
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 @@ -57,7 +57,7 @@ public Iterable<Cookie> get(Boolean ssl, String domain, String path) {
TreeMap<String, Cookie> matches = new TreeMap<>();

Consumer<Cookie> adder = c -> {
if (ssl != Boolean.TRUE && c.isSecure()) {
if (c.isSecure() && (!Boolean.TRUE.equals(ssl) && !"localhost".equals(domain))) {
return;
}
if (c.path() != null && !cleanPath.equals(c.path())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,14 @@ public void testCookieStore(TestContext context) {
validate(context, store.get(true, "test.vertx.io", "/"),
new String[] { "a", "b", "e" },
new String[] { "1", "2", "5" });

c = new DefaultCookie("localhost-secure", "http-localhost");
c.setDomain("localhost");
c.setPath("/");
store.put(c);

validate(context, store.get(true, "localhost", "/"), new String[] { "a", "localhost-secure" }, new String[] { "1", "http-localhost" });
validate(context, store.get(false, "localhost", "/"), new String[] { "a", "localhost-secure" }, new String[] { "1", "http-localhost" });
}

@Test
Expand Down
Loading