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

Re: Interesting problem with ":" in mod_dav_svn XML output

From: Michael Sinz <Michael.Sinz_at_sinz.org>
Date: 2005-10-22 06:26:31 CEST

Michael Sinz wrote:
> Kalle Olavi Niemitalo wrote:
>> Michael Sinz <Michael.Sinz@sinz.org> writes:
>>> Anyway, the problem is that the ":" character is not escaped in the
>>> "href" attribute of the file and directory elements.
>>> This is a problem as the ":" character is a special character that
>>> separates protocol from port within a URL and thus must be escaped
>>> if it is not serving in that manner.
>> Are the "href" attributes in the XML output even documented to be URLs?
> BTW - It is not just in the XML output that this is a problem. The same
> problem exists in the HTML output. The following (see below) HTML was
> generated by mod_dav_svn when no XSLT is defined and clicking on the link
> for the "TestCase-:-/" link - since it now looks like a "TestCase-"
> protocol (vs http) and a path of "-/"
> So, the problem is real and exists even in the basic mod_dav_svn HTML
> output in addition to the XML output.


This change was just a test to verify a possible solution to make this
all work correctly. By pre-pending "./" to each relative URI, the parsing
done by the browser would no longer be within the protocol prefix. That is,
once it hits a (any) path separator there is no more protocol prefix possible.
(Is this by spec? The RFC seems to indirectly call for that due to the list
of valid characters in a protocol prefix.)

Anyway, I don't like this patch since it adds "2 bytes" to every entry
just to not have to deal with the ":" character. It also broke one of my
"hacks" as it assumed the file name only in the href and no path elements
(even if the "./" path element is basically a no-op) I don't know if there
are others that could be bitten by this issue.

A more correct patch would just deal with the ":" correctly. So, I guess I
am not submitting this patch for inclusion but rather as a backstop for
someone that may be running into a problem without it.

Index: repos.c
--- repos.c (revision 16897)
+++ repos.c (working copy)
@@ -2452,6 +2452,10 @@
          if (is_dir)
            href = apr_pstrcat(entry_pool, href, "/", NULL);

+ /* ### To help solve a problem with the ":" character, make the
+ ### paths actually be "./" relative */
+ href = apr_pstrcat(entry_pool, "./" , href, NULL);
          if (gen_html)
            name = href;

Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:michael.sinz@sinz.org
My place on the web                            http://www.sinz.org/Michael.Sinz
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 22 06:28:11 2005

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.