Skip to content

Commit 2f5ff0c

Browse files
authored
Update ProxyAcceptCookiePolicy.java
The guide says: When we create an instance of ProxyAcceptCookiePolicy, we pass in a String of the domain address we would like to accept cookies from **in addition to** the original server.
1 parent c5fbfa2 commit 2f5ff0c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎core-java-networking/src/main/java/com/baeldung/networking/cookies/ProxyAcceptCookiePolicy.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public boolean shouldAccept(URI uri, HttpCookie cookie) {
1717
host = uri.getHost();
1818
}
1919

20-
if (!HttpCookie.domainMatches(acceptedProxy, host)) {
21-
return false;
20+
if (HttpCookie.domainMatches(acceptedProxy, host)) {
21+
return true;
2222
}
2323

2424
return CookiePolicy.ACCEPT_ORIGINAL_SERVER.shouldAccept(uri, cookie);

0 commit comments

Comments
 (0)