commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbe...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpURL.java
Date Sun, 02 May 2004 15:15:34 GMT
mbecke      2004/05/02 08:15:34

  Modified:    httpclient/src/test/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH TestURI.java
               httpclient Tag: HTTPCLIENT_2_0_BRANCH release_notes.txt
               httpclient/src/java/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH HttpURL.java
  Log:
  HttpUrl now accepts unescaped passwords.
  
  PR: 28728
  Submitted by: Michael Becke
  Reviewed by: Oleg Kalnichevski
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.5   +9 -5      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestURI.java
  
  Index: TestURI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestURI.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- TestURI.java	22 Feb 2004 18:21:16 -0000	1.4.2.4
  +++ TestURI.java	2 May 2004 15:15:34 -0000	1.4.2.5
  @@ -181,14 +181,18 @@
           
       }
   
  -
       public void testTestHttpUrlAuthorityString() throws Exception {
           HttpURL url = new HttpURL("localhost", -1, "/");
           assertEquals("http://localhost/", url.toString());
           url.setRawUserinfo("user".toCharArray(), "password".toCharArray());
           assertEquals("http://localhost/", url.toString());
           assertEquals("user:password@localhost", url.getAuthority());
  -        
  +
  +        url = new HttpURL("user", "pass#", "localhost", 8080, "/");
  +        assertEquals("http://localhost:8080/", url.toString());
  +        assertEquals("user:pass#", url.getUserinfo());
  +        assertEquals("user:pass%23", url.getEscapedUserinfo());
  +
           url = new HttpURL("localhost", 8080, "/");
           assertEquals("http://localhost:8080/", url.toString());
           url.setRawUserinfo("user".toCharArray(), "password".toCharArray());
  
  
  
  No                   revision
  No                   revision
  1.9.2.8   +8 -0      jakarta-commons/httpclient/release_notes.txt
  
  Index: release_notes.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/release_notes.txt,v
  retrieving revision 1.9.2.7
  retrieving revision 1.9.2.8
  diff -u -r1.9.2.7 -r1.9.2.8
  --- release_notes.txt	15 Feb 2004 13:11:24 -0000	1.9.2.7
  +++ release_notes.txt	2 May 2004 15:15:34 -0000	1.9.2.8
  @@ -1,3 +1,11 @@
  +Release 2.0.1
  +-------------------
  +Changes since Release 2.0
  +
  + * 28728 - HttpUrl now accepts unescaped passwords
  +
  + * 28626 - Fixed ArrayIndexOutOfBoundsException in HttpStatus.getStatusText()
  +
   Release 2.0
   -------------------
   Changes since Release Candidate 3:
  
  
  
  No                   revision
  No                   revision
  1.12.2.4  +11 -9     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpURL.java
  
  Index: HttpURL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpURL.java,v
  retrieving revision 1.12.2.3
  retrieving revision 1.12.2.4
  diff -u -r1.12.2.3 -r1.12.2.4
  --- HttpURL.java	22 Feb 2004 18:21:13 -0000	1.12.2.3
  +++ HttpURL.java	2 May 2004 15:15:34 -0000	1.12.2.4
  @@ -31,6 +31,8 @@
   
   package org.apache.commons.httpclient;
   
  +import org.apache.commons.httpclient.util.URIUtil;
  +
   /**
    * The HTTP URL.
    *
  @@ -318,11 +320,11 @@
               buff.append(_default_scheme);
               buff.append("://");
               if (userinfo != null) {
  -                buff.append(userinfo);
  +                buff.append(URIUtil.encode(userinfo, URI.allowed_userinfo));
                   buff.append('@');
               }
               if (host != null) {
  -                buff.append(host);
  +                buff.append(URIUtil.encode(host, URI.allowed_host));
                   if (port != -1 || port != DEFAULT_PORT) {
                       buff.append(':');
                       buff.append(port);
  @@ -334,17 +336,17 @@
                   throw new URIException(URIException.PARSING,
                           "abs_path requested");
               }
  -            buff.append(path);
  +            buff.append(URIUtil.encode(path, URI.allowed_abs_path));
           }
           if (query != null) {
               buff.append('?');
  -            buff.append(query);
  +            buff.append(URIUtil.encode(query, URI.allowed_query));
           }
           if (fragment != null) {
               buff.append('#');
  -            buff.append(fragment);
  +            buff.append(URIUtil.encode(fragment, URI.allowed_fragment));
           }
  -        parseUriReference(buff.toString(), false);
  +        parseUriReference(buff.toString(), true);
           checkValid();
       }
   
  
  
  

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


Mime
View raw message