aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-01-10 15:16:04 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-01-10 17:16:22 +0000
commit3fd19343c5e13e5a26740e181de03e702c642eee (patch)
tree375d34fe69e805831f1f4278573f20a42096d30f /perllib/FixMyStreet
parente973904765e4efb242d09d3d41d7f9eb0a294424 (diff)
Allow staging sites to turn off appcache.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Offline.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Offline.pm b/perllib/FixMyStreet/App/Controller/Offline.pm
index 9acb33f7e..5f3b69f2e 100644
--- a/perllib/FixMyStreet/App/Controller/Offline.pm
+++ b/perllib/FixMyStreet/App/Controller/Offline.pm
@@ -11,6 +11,7 @@ FixMyStreet::App::Controller::Offline - Catalyst Controller
=head1 DESCRIPTION
Offline pages Catalyst Controller.
+On staging site, appcache only for people who want it.
=head1 METHODS
@@ -18,6 +19,10 @@ Offline pages Catalyst Controller.
sub manifest : Path("/offline/appcache.manifest") {
my ($self, $c) = @_;
+ if (FixMyStreet->staging_flag('enable_appcache', 0)) {
+ $c->response->status(404);
+ $c->response->body('NOT FOUND');
+ }
$c->res->content_type('text/cache-manifest; charset=utf-8');
$c->res->header(Cache_Control => 'no-cache, no-store');
}
@@ -25,6 +30,10 @@ sub manifest : Path("/offline/appcache.manifest") {
sub appcache : Path("/offline/appcache") {
my ($self, $c) = @_;
$c->detach('/page_error_404_not_found', []) if keys %{$c->req->params};
+ if (FixMyStreet->staging_flag('enable_appcache', 0)) {
+ $c->response->status(404);
+ $c->response->body('NOT FOUND');
+ }
}
__PACKAGE__->meta->make_immutable;