about summary refs log tree commit diff
path: root/pkgs/development/perl-modules
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2013-03-02 10:41:53 +0100
committerVladimír Čunát <vcunat@gmail.com>2013-03-02 10:41:53 +0100
commit26af997d41444e71074c41e82c2eb869b33758f1 (patch)
treeeb4f7fcc4a71a18c85452c927dedc9d9744ad21f /pkgs/development/perl-modules
parent97b24ed95acdd7ad4d7e94b94c0a6eaf3d5fa92a (diff)
parenta920c50cfbe849c9062de81bde050b5672e4e42c (diff)
downloadnixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar.gz
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar.bz2
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar.lz
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar.xz
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.tar.zst
nixlib-26af997d41444e71074c41e82c2eb869b33758f1.zip
Merge branch 'master' into stdenv-updates
Conflicts (simple):
	pkgs/applications/networking/browsers/chromium/default.nix
	pkgs/development/libraries/libsoup/default.nix
	pkgs/os-specific/linux/kernel/manual-config.nix
	pkgs/os-specific/linux/qemu-kvm/default.nix
Diffstat (limited to 'pkgs/development/perl-modules')
-rw-r--r--pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch37
1 files changed, 37 insertions, 0 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
new file mode 100644
index 000000000000..06207a8b7334
--- /dev/null
+++ b/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch
@@ -0,0 +1,37 @@
+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 22:57:18.667150181 +0100
+@@ -187,16 +187,27 @@
+     my $type      = $c->_ext_to_type( $full_path );
+     my $stat      = stat $full_path;
+ 
+-    $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);
++        if (($c->req->header('If-None-Match') // "") eq $etag) {
++            $c->res->status(304);
++            return 1;
++        }
++    }
++
++    $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;