Re: Webdav and url-encoding



On Sat, 2004-02-07 at 00:15, Walter Landry wrote:
> Greetings,
> 
> I am trying to get gnome-vfs to list a directory on a
> webdav-enabled server.  The url is 
> 
>   http://superbeast.ucsd.edu/~landry/ArX/{archive}
> 
> If I just use that as the url, it fails, giving me errors like
> 
>   PROPFIND:2: parser warning : xmlns:D: 'DAV:' is not a valid URI
>   <D:multistatus xmlns:D="DAV:">
>                                ^
>   PROPFIND:3: parser warning : xmlns:lp0: 'DAV:' is not a valid URI
>   <D:response xmlns:lp0="DAV:" xmlns:lp1="http://apache.org/dav/props/"; xmlns:i0="
>   ...
> 
> That is odd, but if I url-encode the brackets "{" and "}" by looking at
> 
>   http://superbeast.ucsd.edu/~landry/ArX/%7barchive%7d

Yeah. All uris you feed into gnome-vfs need to be escaped.
>From RFC 2396:

Other characters are excluded because gateways and other transport
agents are known to sometimes modify such characters, or they are used
as delimiters.

   unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

Data corresponding to excluded characters must be escaped in order to be
properly represented within a URI.

> It gives me the warnings, but at the end it does give me the directory
> listing.  So now if let gnomevfs do the encoding by calling the
> gnome_vfs_escape_host_and_path_string function, it converts the
> original url into
> 
>   http://superbeast.ucsd.edu/~landry/ArX/%7Barchive%7D
> 
> (note the capital letters) and that fails (after giving me the
> warnings).

Its strange that this fails... May be a server side issue? Hex encoding
is supposed to be able to use both upper and lower case. See e.g.
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2396.html, #2.4.1

> But then it gets more interesting.  If I try to list
> 
>   http://regexps.srparish.net/{archives}/lord emf net--2003/
> 
> then it works if I encode the brackets "{" and "}", but not if I
> encode "@".

'@' is not reserved in the path component. See #3.3 of rfc 2396.
However, escaping should always work. Might be a server side bug.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a witless Catholic jungle king searching for his wife's true killer. 
She's a cynical mute pearl diver who can talk to animals. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]