We already dropped CGI from the master branch, drop it from
repobrowse as well to simplify code.
# (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;
# 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);