Skip to content

Commit 5f8b2cb

Browse files
author
Eric Wong
committed
git svn: make minimize URL more reliable over http(s)
In addition to path-based restrictions, Subversion servers over http(s) may have access controls implemented via the LimitExcept directive in Apache. In some cases, LimitExcept may be (arguably) misconfigured to not allow REPORT requests while allowing OPTIONS and PROPFIND. This caused problems with our existing minimize_url logic that only issued OPTIONS and PROPFIND requests when connecting and using SVN::Ra::get_latest_revnum. We now call SVN::Ra::get_log if get_latest_revnum succeeds, resulting in a REPORT request being sent. This will increase our chances of tripping access controls before we start attempting to fetch history. Signed-off-by: Eric Wong <[email protected]>
1 parent 884cce5 commit 5f8b2cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-svn.perl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4831,7 +4831,11 @@ sub minimize_url {
48314831
my $c = '';
48324832
do {
48334833
$url .= "/$c" if length $c;
4834-
eval { (ref $self)->new($url)->get_latest_revnum };
4834+
eval {
4835+
my $ra = (ref $self)->new($url);
4836+
my $latest = $ra->get_latest_revnum;
4837+
$ra->get_log("", $latest, 0, 1, 0, 1, sub {});
4838+
};
48354839
} while ($@ && ($c = shift @components));
48364840
$url;
48374841
}

0 commit comments

Comments
 (0)