Skip to content

Commit

Permalink
Fix date
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Dec 2, 2024
1 parent 0f914f7 commit a09804b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions portal/metadata-ttl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
# Store request parameters in %ENV
--- a/usr/share/perl5/Lemonldap/NG/Portal/Main/Run.pm
+++ b/usr/share/perl5/Lemonldap/NG/Portal/Main/Run.pm
@@ -1450,6 +1450,10 @@ sub sendJSONresponse {
'Cache-Control' => 'no-cache, no-store, must-revalidate',
'Pragma' => 'no-cache',
'Expires' => '0';
@@ -1444,6 +1444,10 @@ sub sendJSONresponse {
# Handle caching
if ( $args{ttl} and $args{ttl} =~ /^\d+$/ ) {
push @{ $res->[1] }, 'Cache-Control' => 'public, max-age=' . $args{ttl};
+ push @{ $res->[1] },
+ 'Last-Modified' =>
+ POSIX::strftime( "%a, %b %0e %H:%M:%S %Y", $args{date} )
+ if $args{date};
}

# If this is a cross-domain request from the portal itself
else {
push @{ $res->[1] },

12 changes: 6 additions & 6 deletions uwsgi-portal/metadata-ttl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
# Store request parameters in %ENV
--- a/usr/share/perl5/Lemonldap/NG/Portal/Main/Run.pm
+++ b/usr/share/perl5/Lemonldap/NG/Portal/Main/Run.pm
@@ -1450,6 +1450,10 @@ sub sendJSONresponse {
'Cache-Control' => 'no-cache, no-store, must-revalidate',
'Pragma' => 'no-cache',
'Expires' => '0';
@@ -1444,6 +1444,10 @@ sub sendJSONresponse {
# Handle caching
if ( $args{ttl} and $args{ttl} =~ /^\d+$/ ) {
push @{ $res->[1] }, 'Cache-Control' => 'public, max-age=' . $args{ttl};
+ push @{ $res->[1] },
+ 'Last-Modified' =>
+ POSIX::strftime( "%a, %b %0e %H:%M:%S %Y", $args{date} )
+ if $args{date};
}

# If this is a cross-domain request from the portal itself
else {
push @{ $res->[1] },

0 comments on commit a09804b

Please sign in to comment.