Michael Sinz <Michael.Sinz@sinz.org> writes:
> Michael Sinz wrote:
>> Kalle Olavi Niemitalo wrote:
>>> Are the "href" attributes in the XML output even documented to be
>>> URLs?
>> From what I know, they are "relative" URLs, specifically formatted
>> (and escaped) to be that. (Check out subversion/mod_dav_svn/repos.c around
>> line 3331 or so.)
> ^^^^ - make that line 2461 in r16897 in /trunk.
Okay. This is in subversion/mod_dav_svn/repos.c (dav_svn_deliver):
| /* We quote special characters in both XML and HTML. */
| name = apr_xml_quote_string(entry_pool, name, !gen_html);
|
| href = ap_escape_uri(entry_pool, href);
| href = apr_xml_quote_string(entry_pool, href, 1);
httpd-2.0.53/include/httpd.h says:
| /**
| * Escape a path segment, as defined in RFC 1808
| * @param p The pool to allocate from
| * @param s The path to convert
| * @return The converted URL
| */
| AP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
| /**
| * convert an OS path to a URL in an OS dependant way.
| * @param p The pool to allocate from
| * @param path The path to convert
| * @param partial if set, assume that the path will be appended to something
| * with a '/' in it (and thus does not prefix "./")
| * @return The converted URL
| */
| AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
| /** @see ap_os_escape_path */
| #define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
httpd-2.0.53/server/util.c (ap_os_escape_path) checks for colons
if partial==0. So the following patch (which I cannot test now)
should fix this.
Another option would be to call ap_escape_path_segment and append
the slash only afterward, but then it would have to be appended
separately to both name and href, leading to more complex code.
- application/pgp-signature attachment: stored
Received on Sat Oct 22 09:27:03 2005