You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by og...@apache.org on 2002/10/21 15:57:42 UTC

cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMethodBase.java URI.java

oglueck     2002/10/21 06:57:42

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpMethodBase.java URI.java
  Log:
  fixed query string encoding
  
  Revision  Changes    Path
  1.69      +9 -11     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
  
  Index: HttpMethodBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- HttpMethodBase.java	21 Oct 2002 12:28:15 -0000	1.68
  +++ HttpMethodBase.java	21 Oct 2002 13:57:41 -0000	1.69
  @@ -377,7 +377,10 @@
       }
   
       /**
  -     * Set my query string.
  +     * Sets the query string.
  +     * The user must ensure that the string is properly URL encoded.
  +     * URIUtil.encodeQuery can be used to encode parameter names and values.
  +     * The query string should not start with the question mark character.
        * 
        * @param queryString the query string
        */
  @@ -1329,12 +1332,7 @@
                   buf.append("?");
               }
               String queryString = null;
  -            try {
  -                queryString = (query == null) ? "/" : URIUtil.encodeQuery(query);
  -            } catch (URIException urie) {
  -                log.error("URI query encoding error");
  -                queryString = query;
  -            }
  +            queryString = (query == null) ? "/" : query;
               buf.append(queryString);
           }
   
  
  
  
  1.5       +6 -4      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java
  
  Index: URI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- URI.java	16 Oct 2002 16:58:26 -0000	1.4
  +++ URI.java	21 Oct 2002 13:57:42 -0000	1.5
  @@ -1411,6 +1411,8 @@
       static {
           allowed_query.or(uric);
           allowed_query.clear('%');
  +        allowed_query.clear('=');
  +        allowed_query.clear('&');
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMethodBase.java URI.java

Posted by Sung-Gu <je...@apache.org>.
Hi Ortwin,

You're doing the opposite totally.  Why do you exlude them? ;)
And more, those characters're aleady included.  :-p
Just you need to get rid of the below code... Then ok.

Sung-Gu

P.S.: The URI class just deals with a string as an escaped sequence.

----- Original Message -----
From: <og...@apache.org>

>   1.5       +6 -4
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java
>
>   Index: URI.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/
URI.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- URI.java 16 Oct 2002 16:58:26 -0000 1.4
>   +++ URI.java 21 Oct 2002 13:57:42 -0000 1.5
>   @@ -1411,6 +1411,8 @@
>        static {
>            allowed_query.or(uric);
>            allowed_query.clear('%');
>   +        allowed_query.clear('=');
>   +        allowed_query.clear('&');
>        }


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>