diff options
Diffstat (limited to 'lib/PublicInbox/RepobrowseBase.pm')
-rw-r--r-- | lib/PublicInbox/RepobrowseBase.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/RepobrowseBase.pm b/lib/PublicInbox/RepobrowseBase.pm index 33647fca..caec5ced 100644 --- a/lib/PublicInbox/RepobrowseBase.pm +++ b/lib/PublicInbox/RepobrowseBase.pm @@ -84,12 +84,11 @@ sub r { if ($status == 301 || $status == 302) { # The goal is to be able to make redirects like we make # <a href=> tags with '../' - my $cgi = $req->{cgi}; - my $base = $cgi->base; + my $env = $req->{env}; + my $base = PublicInbox::Repobrowse::base_url($env); my ($redir) = @extra; if ($redir =~ m!\A\.\./!) { # relative redirect - my @orig = split(m!/+!, $cgi->path_info, -1); - shift @orig; # drop leading '/' + my @orig = split(m!/+!, $env->{PATH_INFO}); my @dest = split(m!/+!, $redir); while ($dest[0] eq '..') { |