#642 requests to /admin/unknown-thing do not get 404
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user