]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
repobrowse: return git errors as text/plain, for now
authorEric Wong <e@80x24.org>
Sun, 19 Feb 2017 03:44:27 +0000 (03:44 +0000)
committerEric Wong <e@80x24.org>
Sun, 19 Feb 2017 19:03:34 +0000 (19:03 +0000)
For now, this avoids an HTML injection vector.  We'll try to
have more consistent error reporting in the future.

lib/PublicInbox/RepoGitDiff.pm

index 0e79f119c185480fe940d2ff2315010fcab4d65a..267284021019c8a81715b0b71dc0af1936b01e2a 100644 (file)
@@ -54,7 +54,7 @@ sub call_git_diff {
        $qsp->psgi_return($env, undef, sub { # parse header
                my ($r) = @_;
                if (!defined $r) {
-                       [ 500, [ 'Content-Type', 'text/html' ], [ $git->err ]];
+                       [ 500, [ 'Content-Type', 'text/plain' ], [ $git->err ]];
                } elsif ($r == 0) {
                        [ 200, [ 'Content-Type', 'text/html' ], [
                                delete($req->{dhtml}).