]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Fix actionless dispatch for non-existent objects
[Gitweb] / gitweb.perl
index 4ba6554fbdb699ec66050b4682ce90111ad0480c712d607c7ab7df4d2becda26..2bfdcca3b3ffe04d61941d45ebab641bf913f978bd1f21690c76cdf7b3c76e99 100755 (executable)
@@ -1124,8 +1124,10 @@ sub dispatch {
        if (!defined $action) {
                if (defined $hash) {
                        $action = git_get_type($hash);
+                       $action or die_error(404, "Object does not exist");
                } elsif (defined $hash_base && defined $file_name) {
                        $action = git_get_type("$hash_base:$file_name");
+                       $action or die_error(404, "File or directory does not exist");
                } elsif (defined $project) {
                        $action = 'summary';
                } else {
@@ -2392,7 +2394,7 @@ sub get_feed_info {
        return unless (defined $project);
        # some views should link to OPML, or to generic project feed,
        # or don't have specific feed yet (so they should use generic)
-       return if ($action =~ /^(?:tags|heads|forks|tag|search)$/x);
+       return if (!$action || $action =~ /^(?:tags|heads|forks|tag|search)$/x);
 
        my $branch;
        # branches refs uses 'refs/heads/' prefix (fullname) to differentiate
This page took 0.316557 seconds and 4 git commands to generate.