Fix a bug where CookieDecoder sets the default maxAge to -1
.. which should be Long.MIN_VALUE
This commit is contained in:
parent
b7ac3edf02
commit
7f3f792017
@ -94,7 +94,7 @@ public final class CookieDecoder {
|
|||||||
String commentURL = null;
|
String commentURL = null;
|
||||||
String domain = null;
|
String domain = null;
|
||||||
String path = null;
|
String path = null;
|
||||||
long maxAge = Integer.MIN_VALUE;
|
long maxAge = Long.MIN_VALUE;
|
||||||
List<Integer> ports = new ArrayList<Integer>(2);
|
List<Integer> ports = new ArrayList<Integer>(2);
|
||||||
|
|
||||||
for (int j = i + 1; j < names.size(); j++, i++) {
|
for (int j = i + 1; j < names.size(); j++, i++) {
|
||||||
|
@ -203,7 +203,7 @@ public class CookieDecoderTest {
|
|||||||
assertNull(c.getCommentUrl());
|
assertNull(c.getCommentUrl());
|
||||||
assertNull(c.getDomain());
|
assertNull(c.getDomain());
|
||||||
assertTrue(c.getPorts().isEmpty());
|
assertTrue(c.getPorts().isEmpty());
|
||||||
assertEquals(-1, c.getMaxAge());
|
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||||
|
|
||||||
c = it.next();
|
c = it.next();
|
||||||
assertEquals(1, c.getVersion());
|
assertEquals(1, c.getVersion());
|
||||||
@ -214,7 +214,7 @@ public class CookieDecoderTest {
|
|||||||
assertNull(c.getCommentUrl());
|
assertNull(c.getCommentUrl());
|
||||||
assertNull(c.getDomain());
|
assertNull(c.getDomain());
|
||||||
assertTrue(c.getPorts().isEmpty());
|
assertTrue(c.getPorts().isEmpty());
|
||||||
assertEquals(-1, c.getMaxAge());
|
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||||
|
|
||||||
assertFalse(it.hasNext());
|
assertFalse(it.hasNext());
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ public class CookieDecoderTest {
|
|||||||
assertNull(c.getCommentUrl());
|
assertNull(c.getCommentUrl());
|
||||||
assertNull(c.getDomain());
|
assertNull(c.getDomain());
|
||||||
assertTrue(c.getPorts().isEmpty());
|
assertTrue(c.getPorts().isEmpty());
|
||||||
assertEquals(-1, c.getMaxAge());
|
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||||
|
|
||||||
assertTrue(it.hasNext());
|
assertTrue(it.hasNext());
|
||||||
c = it.next();
|
c = it.next();
|
||||||
@ -251,7 +251,7 @@ public class CookieDecoderTest {
|
|||||||
assertNull(c.getComment());
|
assertNull(c.getComment());
|
||||||
assertNull(c.getCommentUrl());
|
assertNull(c.getCommentUrl());
|
||||||
assertTrue(c.getPorts().isEmpty());
|
assertTrue(c.getPorts().isEmpty());
|
||||||
assertEquals(-1, c.getMaxAge());
|
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||||
|
|
||||||
assertFalse(it.hasNext());
|
assertFalse(it.hasNext());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user