[libnet-openid-common-perl] 04/07: use numeric-time last_modified accessor, not raw header string (closes #47349)

gregor herrmann gregoa at debian.org
Sun Feb 7 21:50:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to annotated tag v1.13
in repository libnet-openid-common-perl.

commit a9217e91d10e7021949fea16d03c14d5498b922a
Author: Roger Crew <crew at cs.stanford.edu>
Date:   Sat Nov 5 18:21:21 2011 -0700

    use numeric-time last_modified accessor, not raw header string (closes #47349)
---
 lib/Net/OpenID/URIFetch.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/Net/OpenID/URIFetch.pm b/lib/Net/OpenID/URIFetch.pm
index 262dae4..909c30a 100644
--- a/lib/Net/OpenID/URIFetch.pm
+++ b/lib/Net/OpenID/URIFetch.pm
@@ -69,6 +69,7 @@ sub fetch {
         return Net::OpenID::URIFetch::Response->new(
             status => 200,
             content => $ref->{Content},
+            last_modified => $ref->{LastModified},
             headers => $ref->{Headers},
             final_uri => $ref->{FinalURI},
         );
@@ -94,7 +95,7 @@ sub fetch {
         if (my $etag = ($ref->{Headers}->{etag})) {
             $req->header('If-None-Match', $etag);
         }
-        if (my $ts = ($ref->{Headers}->{'last-modified'})) {
+        if (my $ts = $ref->{LastModified}) {
             $req->if_modified_since($ts);
         }
     }
@@ -130,6 +131,7 @@ sub fetch {
 
         my $ret = Net::OpenID::URIFetch::Response->new(
             status => $res->code,
+            last_modified => $res->last_modified,
             content => $content,
             headers => $headers,
             final_uri => $final_uri,
@@ -137,6 +139,7 @@ sub fetch {
 
         if ($cache && $res->code == 200) {
             my $cache_data = {
+                LastModified => $ret->last_modified,
                 Headers => $ret->headers,
                 Content => $ret->content,
                 CacheTime => time(),
@@ -155,7 +158,7 @@ sub fetch {
 package Net::OpenID::URIFetch::Response;
 
 use strict;
-use constant FIELDS => [qw(final_uri status content headers)];
+use constant FIELDS => [qw(final_uri status content headers last_modified)];
 use fields @{FIELDS()};
 use Carp();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-openid-common-perl.git



More information about the Pkg-perl-cvs-commits mailing list