libwww-perl / HTTP-Cookies

Objects that represent a "cookie jar"
https://metacpan.org/pod/HTTP::Cookies
Other
4 stars 17 forks source link

Broken time parsing in "right" timezones [rt.cpan.org #31775] #28

Open oalders opened 7 years ago

oalders commented 7 years ago

Migrated from rt.cpan.org#31775 (status was 'open')

Requestors:

From perl@benizi.com on 2007-12-20 23:30:52:

Test 25 for HTTP::Cookies (in t/base/cookies.t) fails when my timezone
is set to "right/America/New_York", but runs fine in "America/New_York".
It appears the problem might be in HTTP::Date, where (perhaps?) leap
seconds aren't taken into account. (My clock is set to TAI rather than
UTC. See: http://www.thedjbway.org/clockspeed/leapsecs.html for
explanation.)

$old ne $c->as_string on line 404. The dates appear to be the only
difference, and they're off by 23 seconds (the number of leap seconds
since the Unix epoch.)

OLD
Set-Cookie3: foo=bar; path="/"; domain=.a.acme.com; version=1
Set-Cookie3: foo=bar; path="/"; domain=.acme.com; version=1
Set-Cookie3: foo=bar; path="/"; domain=.sol.no; port="90,100,80,8080";
expires="2007-12-20 23:24:13Z"; Comment="Just kidding! (\"|\\) "; version=1
Set-Cookie3: foo9=bar; path="/"; domain=.sol.no; port=_80;
expires="2007-12-20 23:24:13Z"; version=1
Set-Cookie3: foo=bar; path="/foo"; domain=.sol.no; path_spec; version=1
Set-Cookie3: foo8=bar; path="/foo"; domain=www.sol.no; path_spec; version=1

C->as_string
Set-Cookie3: foo=bar; path="/"; domain=.a.acme.com; version=1
Set-Cookie3: foo=bar; path="/"; domain=.acme.com; version=1
Set-Cookie3: foo=bar; path="/"; domain=.sol.no; port="90,100,80,8080";
expires="2007-12-20 23:23:50Z"; Comment="Just kidding! (\"|\\) "; version=1
Set-Cookie3: foo9=bar; path="/"; domain=.sol.no; port=_80;
expires="2007-12-20 23:23:50Z"; version=1
Set-Cookie3: foo=bar; path="/foo"; domain=.sol.no; path_spec; version=1
Set-Cookie3: foo8=bar; path="/foo"; domain=www.sol.no; path_spec; version=1

This is trying to build: libwww-perl-5.808
under perl -v: This is perl, v5.10.0 built for i686-linux
on Gentoo (uname -a): Linux transport 2.6.18-gentoo-r2-benizi #13 Thu
Sep 13 02:01:46 EDT 2007 i686 Intel(R) Pentium(R) M processor 1.10GHz
GenuineIntel GNU/Linux

From perl@benizi.com on 2007-12-21 05:59:54:

Also, test #1 in t/base/response.t works in non-"right". Fails in
"right" because $current_age is 58, rather than 35 (again off by 23).
And 29/59 tests fail in t/base/date.t. (Sorry. Hadn't finished
installing before I wrote the bug report.)

-- Ben

From ether@cpan.org on 2017-01-25 21:39:02:

migrated queues: libwww-perl -> HTTP-Cookies