]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
repobrowse: drop CGI support
authorEric Wong <e@80x24.org>
Fri, 26 Feb 2016 10:38:41 +0000 (10:38 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Apr 2016 18:58:27 +0000 (18:58 +0000)
We already dropped CGI from the master branch, drop it from
repobrowse as well to simplify code.

lib/PublicInbox/Repobrowse.pm
lib/PublicInbox/RepobrowseBase.pm

index 219b44d6b0919f3d97cc846184992b66244e0679..91d0ab208acaa4a1d5fa45b123fa072b4655a498 100644 (file)
@@ -42,16 +42,11 @@ sub r { [ $_[0], ['Content-Type' => 'text/plain'], [ join(' ', @_, "\n") ] ] }
 # (e.g. curl does not follow 301 unless given "-L")
 my %NO_TSLASH = map { $_ => 1 } qw(Log Commit Tree Summary Tag);
 sub no_tslash {
-       my ($cgi) = @_;
+       my ($cgi) = @_; # Plack::Request
        my ($base, $uri);
-       if (ref($cgi) eq 'CGI') {
-               $base = $cgi->url(-base);
-               $uri = $ENV{REQUEST_URI};
-       } else { # Plack::Request
-               $base = $cgi->base;
-               $base =~ s!/+\z!!;
-               $uri = $cgi->request_uri;
-       }
+       $base = $cgi->base;
+       $base =~ s!/+\z!!;
+       $uri = $cgi->request_uri;
        my $qs = '';
        if ($uri =~ s/(\?.+)\z//) {
                $qs = $1;
index dd854ffc5ed273caf611c2193b1087c2ec40925f..7863d6ce2b9239b57a9ff87a45f675f82b64bb3e 100644 (file)
@@ -85,8 +85,7 @@ sub r {
                # The goal is to be able to make redirects like we make
                # <a href=> tags with '../'
                my $cgi = $req->{cgi};
-               my $base;
-               $base = ref($cgi) eq 'CGI' ? $cgi->url(-base).'/' : $cgi->base;
+               my $base = $cgi->base;
                my ($redir) = @extra;
                if ($redir =~ m!\A\.\./!) { # relative redirect
                        my @orig = split(m!/+!, $cgi->path_info, -1);