aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Root.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-01 13:35:17 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-04 16:26:56 +0100
commit88933aa8df0f748dce8188cde99b6199ae070864 (patch)
tree11a5ad35d1ab675a18ec73b752d35f8540414cc4 /perllib/FixMyStreet/App/Controller/Root.pm
parent45aaf63033e7d4d24ba570f7460746fe28f9f59f (diff)
Make sure map JS works through an admin proxy.
Tidy up use of absolute URLs when in the admin. Have the 404 handler spot static files in admin as a fallback.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Root.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Root.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Root.pm b/perllib/FixMyStreet/App/Controller/Root.pm
index 16f4aa491..88f480137 100644
--- a/perllib/FixMyStreet/App/Controller/Root.pm
+++ b/perllib/FixMyStreet/App/Controller/Root.pm
@@ -82,6 +82,13 @@ Display a 404 (not found) or 410 (gone) page. Pass in an optional error message
sub page_error_404_not_found : Private {
my ( $self, $c, $error_msg ) = @_;
+
+ # Try getting static content that might be given under an admin proxy.
+ # First the special generated JavaScript file
+ $c->go('/js/translation_strings', [ $1 ], []) if $c->req->path =~ m{^admin/js/translation_strings\.(.*?)\.js$};
+ # Then a generic static file
+ $c->serve_static_file("web/$1") && return if $c->req->path =~ m{^admin/(.*)};
+
$c->stash->{template} = 'errors/page_error_404_not_found.html';
$c->stash->{error_msg} = $error_msg;
$c->response->status(404);