View | Details | Raw Unified | Return to bug 22835
Collapse All | Expand All

(-)a/Koha/REST/V1/Static.pm (-7 / +1 lines)
Lines 55-61 sub get { Link Here
55
        );
55
        );
56
56
57
        @plugins = grep { $_->api_namespace eq $namespace} @plugins;
57
        @plugins = grep { $_->api_namespace eq $namespace} @plugins;
58
        warn scalar(@plugins);
58
59
        return $c->render({ status => 404, openapi => { error => 'File not found' } }) unless scalar(@plugins) > 0;
59
        return $c->render({ status => 404, openapi => { error => 'File not found' } }) unless scalar(@plugins) > 0;
60
        return $c->render({ status => 500, openapi => { error => 'Namespace not unique' } }) unless scalar(@plugins) == 1;
60
        return $c->render({ status => 500, openapi => { error => 'Namespace not unique' } }) unless scalar(@plugins) == 1;
61
61
Lines 63-75 sub get { Link Here
63
63
64
        my $basepath = $plugin->bundle_path;
64
        my $basepath = $plugin->bundle_path;
65
65
66
        warn $basepath;
67
68
        my $relpath = join ('/', splice (@$path, 5));
66
        my $relpath = join ('/', splice (@$path, 5));
69
67
70
        warn $relpath;
71
72
        warn join('/', $basepath, $relpath);
73
        return try {
68
        return try {
74
            my $asset = Mojo::Asset::File->new(path => join('/', $basepath, $relpath));
69
            my $asset = Mojo::Asset::File->new(path => join('/', $basepath, $relpath));
75
            return $c->render({ status => 404, openapi => { error => 'File not found' } }) unless $asset->is_file;
70
            return $c->render({ status => 404, openapi => { error => 'File not found' } }) unless $asset->is_file;
76
- 

Return to bug 22835