[Catalyst-commits] r13668 - in trunk/Catalyst-Plugin-PageCache: .
lib/Catalyst/Plugin
timbunce at dev.catalyst.perl.org
timbunce at dev.catalyst.perl.org
Mon Nov 1 11:52:40 GMT 2010
Author: timbunce
Date: 2010-11-01 11:52:40 +0000 (Mon, 01 Nov 2010)
New Revision: 13668
Modified:
trunk/Catalyst-Plugin-PageCache/Changes
trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm
Log:
Only serve GET and HEAD requests (instead of all except POST). RT#53307.
Modified: trunk/Catalyst-Plugin-PageCache/Changes
===================================================================
--- trunk/Catalyst-Plugin-PageCache/Changes 2010-11-01 11:41:26 UTC (rev 13667)
+++ trunk/Catalyst-Plugin-PageCache/Changes 2010-11-01 11:52:40 UTC (rev 13668)
@@ -6,6 +6,7 @@
- Fixed t/04critic.t to not fail if Test::Perl::Critic is not installed.
- XXX Test 15busy_lock.t fails as the moment.
- Updated test app code to avoid deprecated constructs.
+ - Only serve GET and HEAD requests (instead of all except POST). RT#53307.
0.22 2009-06-25 10:38:00
- Update to use MRO::Compat
Modified: trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm
===================================================================
--- trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm 2010-11-01 11:41:26 UTC (rev 13667)
+++ trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm 2010-11-01 11:52:40 UTC (rev 13668)
@@ -84,8 +84,10 @@
sub dispatch {
my $c = shift;
- # never serve POST request pages from cache
- return $c->next::method(@_) if ( $c->req->method eq "POST" );
+ # only serve GET and HEAD request pages from cache
+ # (never POST, PUT, DELETE etc)
+ return $c->next::method(@_)
+ unless $c->req->method =~ m/^(?:GET|HEAD)$/;
my $hook =
$c->config->{'Plugin::PageCache'}->{cache_hook}
More information about the Catalyst-commits
mailing list