Subject: | mod_perl2 redirect |
Log and Browse issue a cgi redirect when adding a trailing slash
to the path, ignoring the fact we're using mod_perl2 (or mod_perl, I
suppose).
I attach a quick hack patch of no value for upstream sources, with the
only purpose of clarifying what I'm talking about.
Subject: | svnweb-mod_perl.patch |
--- tmp/SVN-Web-0.49/lib/SVN/Web/Log.pm 2006-08-23 22:44:39.000000000 +0200
+++ /usr/lib/perl5/site_perl/5.8.8/SVN/Web/Log.pm 2006-08-26 20:04:05.715676250 +0200
@@ -226,8 +226,8 @@
my $kind = $root->check_path($path);
if($kind == $SVN::Node::dir) {
if($path !~ m|/$|) {
- print $self->{cgi}
- ->redirect(-uri => $self->{cgi}->self_url() . '/');
+ $self->{cgi}->headers_out->set(Location => $self->{cgi}->unparsed_uri.'/');
+ $self->{cgi}->status(302);
}
}
--- tmp/SVN-Web-0.49/lib/SVN/Web/Browse.pm 2006-08-23 22:44:39.000000000 +0200
+++ /usr/lib/perl5/site_perl/5.8.8/SVN/Web/Browse.pm 2006-08-26 20:02:16.232834000 +0200
@@ -144,8 +144,9 @@
my $kind = $root->check_path($path);
if($path !~ m|/$|) {
- print $self->{cgi}->redirect(-uri => $self->{cgi}->self_url() . '/');
- return;
+ $self->{cgi}->headers_out->set(Location => $self->{cgi}->unparsed_uri.'/');
+ $self->{cgi}->status(302);
+ return 302;
}
$path =~ s|/$|| unless $path eq '/';