commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestWebappRedirect.java
Date Tue, 22 Oct 2002 18:23:25 GMT
oglueck     2002/10/22 11:23:25

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpMethodBase.java URI.java
               httpclient/src/test/org/apache/commons/httpclient
                        TestWebappRedirect.java
  Log:
  fixed double URL decoding on redirect
  added more escaped characters for querystrings
  fixed test
  
  Revision  Changes    Path
  1.70      +5 -5      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.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- HttpMethodBase.java	21 Oct 2002 13:57:41 -0000	1.69
  +++ HttpMethodBase.java	22 Oct 2002 18:23:24 -0000	1.70
  @@ -877,7 +877,7 @@
                       String absolutePath = URIUtil.getPath(url.toString());
                       String query = URIUtil.getQuery(url.toString());
                       setPath(URIUtil.decode(absolutePath));
  -                    setQueryString(query == null ? null : URIUtil.decode(query));
  +                    setQueryString(query == null ? null : query);
   
                       if (log.isDebugEnabled()) {
                           log.debug("Changing path from \"" + getPath()
  
  
  
  1.6       +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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- URI.java	21 Oct 2002 13:57:42 -0000	1.5
  +++ URI.java	22 Oct 2002 18:23:24 -0000	1.6
  @@ -1413,6 +1413,8 @@
           allowed_query.clear('%');
           allowed_query.clear('=');
           allowed_query.clear('&');
  +        allowed_query.clear('?');
  +        allowed_query.clear('#');
       }
   
   
  
  
  
  1.8       +8 -8      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappRedirect.java
  
  Index: TestWebappRedirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappRedirect.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestWebappRedirect.java	21 Oct 2002 14:03:07 -0000	1.7
  +++ TestWebappRedirect.java	22 Oct 2002 18:23:25 -0000	1.8
  @@ -169,11 +169,11 @@
           client.startSession(host, port);
           GetMethod method = new GetMethod("/" + context + "/redirect");
   
  -        String qs = URIUtil.encodeQuery("http://" + host + ":" + port + "/" + context +
"/params?foo=bar&bar=foo");
  -        for(int i=0;i<10;i++) {
  -            qs = "to=" + URIUtil.encodeQuery("http://" + host + ":" + port + "/" + context
+ "/redirect?to=" + qs);
  +        String qs = "http://" + host + ":" + port + "/" + context + "/params?foo=bar&bar=foo";
  +        for(int i=0;i<2;i++) {
  +            qs = "http://" + host + ":" + port + "/" + context + "/redirect?to=" + URIUtil.encodeQuery(qs);
           }
  -        method.setQueryString(qs);
  +        method.setQueryString("to=" + URIUtil.encodeQuery(qs));
           method.setUseDisk(false);
           try {
               client.executeMethod(method);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message