[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Hostnames should be case-insensitive - tryiing to solve issue 2475

From: Branko Čibej <brane_at_xbc.nu>
Date: 2006-03-08 02:06:54 CET

Lieven Govaerts wrote:
> Hi,
>
> I started working on issue 2475. The problem reported in that issue is that
> hostnames in URIs should be case-insensitive ( as per RFC3986 ).
>
> The problem surfaces when two URLs are compared. E.g. when a file is copied
> from one folder to another, a case-sensitive check is done wether source and
> target folders are from the same repository.
>
> Now, I've checked the code for places where this type of test is done, and I
> found some 30 instances of strcmp & strncmp where URLs are involved. Most of
> them in libsvn_client and libsvn_wc, some in libsvn_ra* and libsvn_repos.
>
> I see some possible options to solve this:
>
> Option 1. Make lowercase of all the hostnames in all the URLs on entry point
> in the code, don't touch the case-sensitive checks. Maybe the easiest
> solution, but not very clear in error messages etc.
>
> Option 2. Replace all the strcmp and strncmp calls ( only those where URLs
> are compared ) with their case-insensitive equivalents.
>
That would be wrong; the path part of the URL is *not* case-insensitive.

> Option 3. Create one new function url_compare() where a correct,
> standards-compliant URL comparison is implemented, use that function in all
> places where strcmp/strncmp is used now. What would be a good place to
> define such a function?
>
> I prefer option 3 myself. Maybe there are other and better options? Anybody
> any thoughts on the subject?
>
Option 4. Follow the conventions we already use for paths: i.e., the API
expects all path parameters in canonical form. Define the canonical form
for URLs so that the hostname part must be lowercase (but only the host
name, not the optional embedded user name). Document that, then perform
the URL canonicalisation in the client code, as we do with file names --
*not* in the library code.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 8 02:07:32 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.