Checkout
Julian Foad
committed
on 13 Sep
When following an HTTP redirect, use the Location header URL exactly.

Previously we canonicalized the redirect URL, which could lead to a r… Show more
When following an HTTP redirect, use the Location header URL exactly.

Previously we canonicalized the redirect URL, which could lead to a redirect

loop. Then Subversion would report a redirect loop as the error, potentially

hiding a more interesting error such as when the target is not in fact a

Subversion repository.

A manual test case (on a non-repository):

 before:

   $ svn ls https://archive.apache.org/dist

   Redirecting to URL 'https://archive.apache.org/dist':

   Redirecting to URL 'https://archive.apache.org/dist':

   svn: E195019: Redirect cycle detected for URL 'https://archive.apache.org/dist'

 after:

   $ svn ls https://archive.apache.org/dist

   Redirecting to URL 'https://archive.apache.org/dist/':

   svn: E170013: Unable to connect to a repository at URL 'https://archive.apache.org/dist/'

   svn: E175003: The server at 'https://archive.apache.org/dist/' does not support the HTTP/DAV protocol

* subversion/libsvn_ra_serf/options.c

 (svn_ra_serf__exchange_capabilities): Don't canonicalize the redirect URL.

* subversion/libsvn_ra_serf/util.c

 (response_get_location): Don't canonicalize the redirect URL.

Show less