commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r507324 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
Date Wed, 14 Feb 2007 00:12:12 GMT
Author: sebb
Date: Tue Feb 13 16:12:11 2007
New Revision: 507324

URL: http://svn.apache.org/viewvc?view=rev&rev=507324
Log:
password can be null

Modified:
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java?view=diff&rev=507324&r1=507323&r2=507324
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
Tue Feb 13 16:12:11 2007
@@ -549,7 +549,8 @@
                     "escaped user not valid");
         }
         String username = new String(escapedUser);
-        String password = new String(getRawPassword());
+        char[] rawPassword = getRawPassword();
+		String password = rawPassword == null ? null : new String(rawPassword);
         String userinfo = username + ((password == null) ? "" : ":" + password);
         String hostname = new String(getRawHost());
         String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
@@ -644,7 +645,7 @@
             throw new URIException(URIException.PARSING, "username required");
         }
         String username = new String(getRawUser());
-        String password = new String(escapedPassword);
+        String password = escapedPassword == null ? null : new String(escapedPassword);
         // an emtpy string is allowed as a password
         String userinfo = username + ((password == null) ? "" : ":" + password);
         String hostname = new String(getRawHost());



---------------------------------------------------------------------
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