diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-02-26 01:24:32 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-02-26 01:24:32 +0100 |
commit | f7e619617e548554d3a853f7a2550617bc218852 (patch) | |
tree | 90c2e28e29ec9d3eecc06d080c4e032a9dd2a282 | |
parent | d2b6645e82be74f22c2333915d262bd0719ceede (diff) | |
download | nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar.gz nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar.bz2 nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar.lz nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar.xz nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.tar.zst nixpkgs-f7e619617e548554d3a853f7a2550617bc218852.zip |
Catalyst::Plugin::Static::Simple: Always send the Expires header
Otherwise Firefox will get confused.
-rw-r--r-- | pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch b/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch index 6433cf29663..06207a8b733 100644 --- a/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch +++ b/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch @@ -2,14 +2,24 @@ Send an ETag header, and honour the If-None-Match request header diff -ru -x '*~' Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm --- Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm 2012-05-04 18:49:30.000000000 +0200 -+++ Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm 2013-02-25 18:05:08.466813337 +0100 -@@ -187,11 +187,21 @@ ++++ Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm 2013-02-25 22:57:18.667150181 +0100 +@@ -187,16 +187,27 @@ my $type = $c->_ext_to_type( $full_path ); my $stat = stat $full_path; -+ # Tell Firefox & friends its OK to cache, even over SSL: +- $c->res->headers->content_type( $type ); +- $c->res->headers->content_length( $stat->size ); +- $c->res->headers->last_modified( $stat->mtime ); + # Tell Firefox & friends its OK to cache, even over SSL: +- $c->res->headers->header('Cache-control' => 'public'); + #$c->res->headers->header('Cache-control' => 'public'); + ++ $c->res->headers->last_modified( $stat->mtime ); + # Optionally, set a fixed expiry time: + if ($config->{expires}) { + $c->res->headers->expires(time() + $config->{expires}); + } + + if ($config->{send_etag}) { + my $etag = '"' . $stat->mtime . '-' . $stat->ino . '-'. $stat->size . '"'; + $c->res->headers->header('ETag' => $etag); @@ -19,11 +29,9 @@ diff -ru -x '*~' Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Sta + } + } + - $c->res->headers->content_type( $type ); - $c->res->headers->content_length( $stat->size ); - $c->res->headers->last_modified( $stat->mtime ); -- # Tell Firefox & friends its OK to cache, even over SSL: -- $c->res->headers->header('Cache-control' => 'public'); - # Optionally, set a fixed expiry time: - if ($config->{expires}) { - $c->res->headers->expires(time() + $config->{expires}); ++ $c->res->headers->content_type( $type ); ++ $c->res->headers->content_length( $stat->size ); ++ + my $fh = IO::File->new( $full_path, 'r' ); + if ( defined $fh ) { + binmode $fh; |