You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Robert Owen <Ro...@sas.com> on 2002/01/31 18:09:38 UTC
Unescaping URL
I'm experiencing problems with how some unescaping is taking place in the
Slide client (WebDavResource, PropFindMethod). The generic URI spec says
that '+' is not reserved for the path component of a URI and so
"http://host/One+Two" should refer to a resource called "/One+Two". However,
the unescape routines used replace a '+' with a ' ' (blank), whether it is
the path or any other part of the url that is being unescaped. Trying the
following:
WebdavResource wd = new WebdavResource(http://host/One+Two);
success = wd.mkcolMethod();
tries to do a MKCOL on "/One Two" - passes the url to the method expecting
an escaped path (HttpUrl.getPath(path)). One way of getting around this is
to call the method with an escaped url (for those methods that allow this)
boolean success = webdavResource.mkcolMethod(httpURL.getEscapedPath());
now this does do a MKCOL on "/One+Two". However, when one does a PROPFIND
for example, the <href> in the response is decoded (URLDecode) and the '+'
is replaced with a blank, reporting properties on "/One Two". What is the
correct approach to getting this to work ?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unescaping URL
Posted by Dirk Verbeeck <di...@pandora.be>.
The '+' sign shouldn't be decoded it it is the path part of the uri.
Only in the query string part (behind the '?' should it be decoded.)
Dirk
Robert Owen wrote:
>
> I'm experiencing problems with how some unescaping is taking place in the
> Slide client (WebDavResource, PropFindMethod). The generic URI spec says
> that '+' is not reserved for the path component of a URI and so
> "http://host/One+Two" should refer to a resource called "/One+Two". However,
> the unescape routines used replace a '+' with a ' ' (blank), whether it is
> the path or any other part of the url that is being unescaped. Trying the
> following:
>
> WebdavResource wd = new WebdavResource(http://host/One+Two);
> success = wd.mkcolMethod();
>
> tries to do a MKCOL on "/One Two" - passes the url to the method expecting
> an escaped path (HttpUrl.getPath(path)). One way of getting around this is
> to call the method with an escaped url (for those methods that allow this)
>
> boolean success = webdavResource.mkcolMethod(httpURL.getEscapedPath());
>
> now this does do a MKCOL on "/One+Two". However, when one does a PROPFIND
> for example, the <href> in the response is decoded (URLDecode) and the '+'
> is replaced with a blank, reporting properties on "/One Two". What is the
> correct approach to getting this to work ?
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>