Skip to content

Commit 73cce69

Browse files
authored
Increase CookieParam.Expires size (#345)
1 parent 6940d59 commit 73cce69

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Threading.Tasks;
2+
using Xunit;
3+
using Xunit.Abstractions;
4+
using System.Linq;
5+
6+
namespace PuppeteerSharp.Tests.Issues
7+
{
8+
[Collection("PuppeteerLoaderFixture collection")]
9+
public class Issue0343 : PuppeteerPageBaseTest
10+
{
11+
public Issue0343(ITestOutputHelper output) : base(output)
12+
{
13+
}
14+
15+
[Fact]
16+
public async Task ShouldSupportLongExpiresValueInCookies()
17+
{
18+
await Page.GoToAsync(TestConstants.EmptyPage);
19+
var longExpiresValue = 3677410981.1125112d;
20+
await Page.SetCookieAsync(new CookieParam
21+
{
22+
Name = "password",
23+
Value = "123456",
24+
Expires = longExpiresValue
25+
});
26+
var cookies = await Page.GetCookiesAsync();
27+
Assert.Equal(longExpiresValue, cookies.First(c => c.Name == "password").Expires);
28+
}
29+
}
30+
}

lib/PuppeteerSharp/CookieParam.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class CookieParam
4545
/// </summary>
4646
/// <value>Expiration.</value>
4747
[JsonProperty("expires", NullValueHandling = NullValueHandling.Ignore)]
48-
public int? Expires { get; set; }
48+
public double? Expires { get; set; }
4949
/// <summary>
5050
/// Gets or sets the size.
5151
/// </summary>

0 commit comments

Comments
 (0)