Skip to content

Commit

Permalink
Fixing cookie parsing error in .NET bindings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jimevans committed Jul 1, 2015
1 parent 407cce9 commit df012b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/Cookie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ public static Cookie FromDictionary(Dictionary<string, object> rawCookie)
DateTime? expires = null;
if (rawCookie.ContainsKey("expiry") && rawCookie["expiry"] != null)
{
long seconds = 0;
if (long.TryParse(rawCookie["expiry"].ToString(), out seconds))
double seconds = 0;
if (double.TryParse(rawCookie["expiry"].ToString(), NumberStyles.Number, CultureInfo.InvariantCulture, out seconds))
{
try
{
Expand Down

0 comments on commit df012b8

Please sign in to comment.