fix errors for api to be json

This commit is contained in:
Oliver Gorwits
2019-03-20 21:18:12 +00:00
parent 1e32f802f8
commit 52e2751b50
3 changed files with 9 additions and 3 deletions

View File

@@ -123,6 +123,11 @@ hook after_error_render => sub { setting('layout' => 'main') };
for @port_columns;
}
# support for checking if this is an api request even after forward
hook 'before' => sub {
vars->{'orig_path'} = request->path unless request->is_forward;
};
hook 'before' => sub {
my $key = request->path;
if (param('tab') and ($key !~ m/ajax/)) {