[Rt-commit] r18863 - rt/3.999/branches/datetime/lib/RT/Interface

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 19 16:16:10 EDT 2009


Author: sartak
Date: Thu Mar 19 16:16:07 2009
New Revision: 18863

Modified:
   rt/3.999/branches/datetime/lib/RT/Interface/Web.pm

Log:
Use RT::DateTime for generating the expires header

Modified: rt/3.999/branches/datetime/lib/RT/Interface/Web.pm
==============================================================================
--- rt/3.999/branches/datetime/lib/RT/Interface/Web.pm	(original)
+++ rt/3.999/branches/datetime/lib/RT/Interface/Web.pm	Thu Mar 19 16:16:07 2009
@@ -204,13 +204,12 @@
 =cut
 
 sub static_file_headers {
-    my $date = RT::Date->new( current_user => RT->system_user );
-
     # make cache public
     $HTML::Mason::Commands::r->headers_out->{'Cache-Control'} = 'max-age=259200, public';
 
     # Expire things in a month.
-    $date->set( value => time + 30 * 24 * 60 * 60 );
+    my $date = RT::DateTime->now;
+    $date->add(months => 1);
     $HTML::Mason::Commands::r->headers_out->{'Expires'} = $date->rfc2616;
 
     # if we set 'Last-Modified' then browser request a comp using 'If-Modified-Since'


More information about the Rt-commit mailing list