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 domain = null;
|
||||
String path = null;
|
||||
long maxAge = Integer.MIN_VALUE;
|
||||
long maxAge = Long.MIN_VALUE;
|
||||
List<Integer> ports = new ArrayList<Integer>(2);
|
||||
|
||||
for (int j = i + 1; j < names.size(); j++, i++) {
|
||||
|
@ -203,7 +203,7 @@ public class CookieDecoderTest {
|
||||
assertNull(c.getCommentUrl());
|
||||
assertNull(c.getDomain());
|
||||
assertTrue(c.getPorts().isEmpty());
|
||||
assertEquals(-1, c.getMaxAge());
|
||||
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||
|
||||
c = it.next();
|
||||
assertEquals(1, c.getVersion());
|
||||
@ -214,7 +214,7 @@ public class CookieDecoderTest {
|
||||
assertNull(c.getCommentUrl());
|
||||
assertNull(c.getDomain());
|
||||
assertTrue(c.getPorts().isEmpty());
|
||||
assertEquals(-1, c.getMaxAge());
|
||||
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
@ -239,7 +239,7 @@ public class CookieDecoderTest {
|
||||
assertNull(c.getCommentUrl());
|
||||
assertNull(c.getDomain());
|
||||
assertTrue(c.getPorts().isEmpty());
|
||||
assertEquals(-1, c.getMaxAge());
|
||||
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||
|
||||
assertTrue(it.hasNext());
|
||||
c = it.next();
|
||||
@ -251,7 +251,7 @@ public class CookieDecoderTest {
|
||||
assertNull(c.getComment());
|
||||
assertNull(c.getCommentUrl());
|
||||
assertTrue(c.getPorts().isEmpty());
|
||||
assertEquals(-1, c.getMaxAge());
|
||||
assertEquals(Long.MIN_VALUE, c.getMaxAge());
|
||||
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user