Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 736b0cc

Browse files
author
Stephane Landelle
committed
Revive Cookie extra constructors
1 parent e5b455f commit 736b0cc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

api/src/main/java/com/ning/http/client/Cookie.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ public class Cookie implements Comparable<Cookie>{
3636
private Set<Integer> ports = Collections.emptySet();
3737
private Set<Integer> unmodifiablePorts = ports;
3838

39+
public Cookie(String domain, String name, String value, String path, int maxAge, boolean secure) {
40+
this(domain, name, value, path, maxAge, secure, 1);
41+
}
42+
43+
public Cookie(String domain, String name, String value, String path, int maxAge, boolean secure, int version) {
44+
this(domain, name, value, path, maxAge, secure, version, false, false, null, null, Collections.<Integer> emptySet());
45+
}
46+
3947
public Cookie(String domain, String name, String value, String path, int maxAge, boolean secure, int version, boolean httpOnly, boolean discard, String comment, String commentUrl, Iterable<Integer> ports) {
4048

4149
if (name == null) {

api/src/test/java/com/ning/http/client/async/AsyncProvidersBasicTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.nio.channels.UnresolvedAddressException;
3131
import java.util.Arrays;
3232
import java.util.Collection;
33-
import java.util.Collections;
3433
import java.util.HashMap;
3534
import java.util.List;
3635
import java.util.Map;
@@ -481,7 +480,7 @@ public void asyncDoGetCookieTest() throws Throwable {
481480
h.add("Test4", "Test4");
482481
h.add("Test5", "Test5");
483482

484-
final Cookie coo = new Cookie("/", "foo", "value", "/", -1, false, 1, false, false, null, null, Collections.<Integer> emptySet());
483+
final Cookie coo = new Cookie("/", "foo", "value", "/", -1, false);
485484
c.prepareGet(getTargetUrl()).setHeaders(h).addCookie(coo).execute(new AsyncCompletionHandlerAdapter() {
486485

487486
@Override

0 commit comments

Comments
 (0)