Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadJSON parsing cookie expiry #135

Closed
dten opened this Issue Oct 26, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@dten
Copy link

dten commented Oct 26, 2017

Recently (not sure when) the expiry time in cookies has sub section precision which causes BadJSON trying to parse it as an Integer

e.g. a cookie with "expiry":1509022264.455114
results in uncaught exception: BadJSON (BadJSON "Floating number specified for Integer: 1.509022264.455114e9")

, cookExpiry :: Maybe Integer -- ^Expiry date expressed as

Currently marked as an Integer in the type

Suspect this needs to be either a Double or a pair of something (often nanos is separated out)

@swamp-agr

This comment has been minimized.

Copy link
Contributor

swamp-agr commented Jun 29, 2018

Hi @dten,

Suggested by you fix works fine for me! I am able to dump and restore cookie data in my tests.

Thanks,
Andrey

@cvogt

This comment has been minimized.

Copy link

cvogt commented Oct 16, 2018

Experienced the same issue BadJSON "expected Integer, encountered floating number 1.571236758435066e9". Proposed fix looks correct!

Workaround:


import Data.Aeson
import Test.WebDriver.Commands.Internal
import Test.WebDriver.Class

...
   do
    ...
     c :: Value <- doSessCommand methodGet "/cookie" Null
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.