commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@multitask.com.au
Subject RE: [httpclient] double encoding of %
Date Thu, 18 Jul 2002 17:01:59 GMT
"Jeff Dever" <jdever1@nortelnetworks.com> wrote on 07/18/2002 01:58:42 AM:

> Xiaowei,
> 
> I agree with your point.  HttpClient already does have the concept of 
some
> characters being "safe" and the rest get encoded.  Please attach your
> comments to the bug report so that it will be considered for addition in 
a
> 2.0 release milestone.
> 

+1 - I consider the current behaviour a bug....

> 
> 
> -----Original Message-----
> From: Xiaowei Jiang [mailto:xiaowei@stratify.com]
> Sent: Tuesday, July 16, 2002 3:05 PM
> To: 'Jakarta Commons Developers List'
> Subject: RE: [httpclient] double encoding of %
> 
> 
> The resolution is pretty simple. In the initialization code for pathSafe 
in
> URIUtil, add the following 
> 
>         pathSafe.set('%');
> 
> This will make '%' a 'safe' character in path and it won't encode it 
again.
> Just need somebody to check in this change. thanks
> 
> xiaowei
> 
> -----Original Message-----
> From: Kyle R . Burton [mailto:mortis@voicenet.com]
> Sent: Tuesday, July 16, 2002 12:02 PM
> To: Jakarta Commons Developers List
> Subject: Re: [httpclient] double encoding of %
> 
> 
> > double encoding of URLs
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6624
> > 
> > This bug was marked as invalid. But I believe that person doesn't 
really
> > understand the problem. The issue is you have to be able to copy a URL
> from
> > IE's address bar, put it in httpclient and it should just work. 
However,
> > when the path has space in it, IE will show %20 in the address bar and
> > httpclient will encode the % again. Please think hard about it before 
you
> > really decide it's invalid. My suggestion is that % should never be
> escaped.
> > If the user really wants a literal %, he can encode it himself.
> 
> I don't know what the resolution will be on this, but for the time-being
> you could decode the URL before cutting &pasting it into httpclient. 
> There is even a URIUtil class that can do the decoding for you:
> 
>   import org.apache.commons.httpclient.URIUtil;
> 
>   ...
> 
>     String encodedUrl = 
"http://localhost/?this=that%20and+the+other+thing";
>     String decodedUrl = URIUtil.decode( encodedUrl );
> 
> 
> hth
> 
> Kyle R. Burton
--
dIon Gillard, Multitask Consulting
Work:      http://www.multitask.com.au
Developers: http://adslgateway.multitask.com.au/developers



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message