Skip to content

Commit

Permalink
#642 requests to /admin/unknown-thing do not get 404
Browse files Browse the repository at this point in the history
  • Loading branch information
ollyg committed Sep 3, 2019
1 parent 2897eda commit 82a99ea
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lib/App/Netdisco/Web/AdminTask.pm
Expand Up @@ -59,13 +59,20 @@ ajax qr{/ajax/control/admin/(?:\w+/)?delete} => require_role setting('defanged_a
get '/admin/*' => require_role admin => sub {
my ($tag) = splat;

# trick the ajax into working as if this were a tabbed page
params->{tab} = $tag;

var(nav => 'admin');
template 'admintask', {
task => setting('_admin_tasks')->{ $tag },
};
if (exists setting('_admin_tasks')->{ $tag }) {
# trick the ajax into working as if this were a tabbed page
params->{tab} = $tag;

var(nav => 'admin');
template 'admintask', {
task => setting('_admin_tasks')->{ $tag },
};
}
else {
var('notfound' => true);
status 'not_found';
template 'index';
}
};

true;

0 comments on commit 82a99ea

Please sign in to comment.