diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-13 18:21:06 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-13 18:21:06 +0000 |
commit | 4121d77d4d42067e5fd974d9880ba061e580f118 (patch) | |
tree | 5a248c6717f40c68506f8a344f9668a7dab8347a /lib | |
parent | 0c49bac0a0dc7e641970bff3e29162ec0b4ea610 (diff) | |
download | ruby-4121d77d4d42067e5fd974d9880ba061e580f118.tar.gz ruby-4121d77d4d42067e5fd974d9880ba061e580f118.tar.xz ruby-4121d77d4d42067e5fd974d9880ba061e580f118.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@11714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/uri/generic.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index d166757fe..cae616919 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 |