Skip Menu |

This queue is for tickets about the Firefox-Marionette CPAN distribution.

Report information
The Basics
Id: 130955
Status: resolved
Priority: 0/
Queue: Firefox-Marionette

People
Owner: Nobody in particular
Requestors: bokutin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: patch to method add_cookie
hi. I found a problem with the method add_cookies. Attach the script that reproduces the problem and its patch. Thanks, Tomohiro Hosaka ### script ### #!/usr/local/bin/perl use rlib; use Modern::Perl; use Firefox::Marionette; use YAML::Syck; { my $ff = Firefox::Marionette->new; $ff->go("https://www.google.com"); # All cookies have a "expiry". # fine $ff->add_cookie($_) for $ff->cookies; } { my $ff = Firefox::Marionette->new; $ff->go("https://www.amazon.com"); # There are cookies that do not have a "expiry". # Exception occured. invalid argument: Cookie expiry must be a positive integer $ff->add_cookie($_) for $ff->cookies; } __END__ # say Dump [$ff->cookies]; # --- # - !!perl/hash:Firefox::Marionette::Cookie # domain: .amazon.com # http_only: 0 # name: skin # path: / # secure: 0 # value: noskin # - !!perl/hash:Firefox::Marionette::Cookie # domain: .amazon.com # expiry: '2082787201' # http_only: 0 # name: session-id # path: / # secure: 0 # value: 142-5535180-0213954 # ... snip ... ### patch ### diff --git a/lib/Firefox/Marionette.pm b/lib/Firefox/Marionette.pm index c3dc918..051fd47 100755 --- a/lib/Firefox/Marionette.pm +++ b/lib/Firefox/Marionette.pm @@ -2611,7 +2611,7 @@ sub add_cookie { domain => $domain, path => $cookie->path(), value => $cookie->value(), - expiry => $cookie->expiry(), + ( $cookie->expiry() ? ( expiry => $cookie->expiry() ) : () ), name => $cookie->name() } }
On Mon Nov 11 01:24:09 2019, bokutin wrote: Show quoted text
> hi. > > I found a problem with the method add_cookies. > > Attach the script that reproduces the problem and its patch.
Thanks for patch and bug report. Just uploaded 0.85 to resolve this.
I ran 0.85 to see the fix. Thank you!