Skip to content

Commit df012b8

Browse files
committed
Fixing cookie parsing error in .NET bindings
The JSON response for cookie expiration date is a number, not an integer. The .NET bindings were not handling the fact that a floating point number could be included in the JSON object as an expiration time.
1 parent 407cce9 commit df012b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: dotnet/src/webdriver/Cookie.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ public static Cookie FromDictionary(Dictionary<string, object> rawCookie)
239239
DateTime? expires = null;
240240
if (rawCookie.ContainsKey("expiry") && rawCookie["expiry"] != null)
241241
{
242-
long seconds = 0;
243-
if (long.TryParse(rawCookie["expiry"].ToString(), out seconds))
242+
double seconds = 0;
243+
if (double.TryParse(rawCookie["expiry"].ToString(), NumberStyles.Number, CultureInfo.InvariantCulture, out seconds))
244244
{
245245
try
246246
{

0 commit comments

Comments
 (0)