#642 requests to /admin/unknown-thing do not get 404

This commit is contained in:
Oliver Gorwits
2019-09-03 09:36:50 +01:00
parent 2897eda684
commit 82a99ea94e

View File

@@ -59,13 +59,20 @@ ajax qr{/ajax/control/admin/(?:\w+/)?delete} => require_role setting('defanged_a
get '/admin/*' => require_role admin => sub { get '/admin/*' => require_role admin => sub {
my ($tag) = splat; my ($tag) = splat;
# trick the ajax into working as if this were a tabbed page if (exists setting('_admin_tasks')->{ $tag }) {
params->{tab} = $tag; # trick the ajax into working as if this were a tabbed page
params->{tab} = $tag;
var(nav => 'admin'); var(nav => 'admin');
template 'admintask', { template 'admintask', {
task => setting('_admin_tasks')->{ $tag }, task => setting('_admin_tasks')->{ $tag },
}; };
}
else {
var('notfound' => true);
status 'not_found';
template 'index';
}
}; };
true; true;