libwww-perl / libwww-perl/HTTP-Cookies
Broken time parsing in "right" timezones [rt.cpan.org #31775]
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 4
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Migrated from rt.cpan.org#31775 (status was 'open')
Requestors:
- perl@benizi.com
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the failures described in t/base/cookies.t, t/base/response.t, and t/base/date.t with the timezone set to right/America/New_York, then inspect the HTTP::Date behavior mentioned in the report. Compare the date values with America/New_York and determine how leap seconds affect them; done means the affected tests pass in both timezone forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100