aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-13 18:21:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-13 18:21:06 +0000
commitbcbdd1f66014a682c0e6ba30a66aa27cc2ae6f92 (patch)
tree5a248c6717f40c68506f8a344f9668a7dab8347a
parent1e41cf48858d68c335a34a7c68650160f6189693 (diff)
downloadruby-bcbdd1f66014a682c0e6ba30a66aa27cc2ae6f92.tar.gz
* lib/uri/generic.rb (URI::Generic::userinfo): should support
empty password. [ruby-core:10290] * lib/uri/generic.rb (URI::Generic::set_password): password can be cleared by nil. [ruby-core:10290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--lib/uri/generic.rb6
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a51132181b..572c5c91b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Feb 14 03:14:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic::userinfo): should support
+ empty password. [ruby-core:10290]
+
+ * lib/uri/generic.rb (URI::Generic::set_password): password can be
+ cleared by nil. [ruby-core:10290]
+
Wed Feb 14 00:30:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (init_unixsock): path may contain NUL for
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index d166757fef..cae6169190 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -337,7 +337,7 @@ module URI
protected :set_user
def set_password(v)
- set_userinfo(@user, v)
+ @password = v
v
end
protected :set_password
@@ -356,7 +356,9 @@ module URI
private :escape_userpass
def userinfo
- if !@password
+ if @user.nil? or @user.empty?
+ nil
+ elsif @password.nil? or @password.empty?
@user
else
@user + ':' + @password