diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-15 07:45:04 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-15 07:45:04 +0000 |
| commit | 27da43580ba6cd173269680d2c4f3625d1c1d4de (patch) | |
| tree | ca55d7248674eaa58de3c5aac801f465e58a9255 /lib | |
| parent | ed55b0d5a2812695f94573a9932e69c7350207cc (diff) | |
| download | ruby-27da43580ba6cd173269680d2c4f3625d1c1d4de.tar.gz ruby-27da43580ba6cd173269680d2c4f3625d1c1d4de.tar.xz ruby-27da43580ba6cd173269680d2c4f3625d1c1d4de.zip | |
* lib/uri/generic.rb (URI::Generic::userinfo): Considering how
`scheme://user:@...', `scheme://:password@...' and
`scheme://:@...' are parsed, an empty user name or password
should be allowed and represented as it is.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@11751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/uri/generic.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index cae616919..2b66adeb9 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -304,19 +304,19 @@ module URI end check_userinfo(*userinfo) set_userinfo(*userinfo) - userinfo + # returns userinfo end def user=(user) check_user(user) set_user(user) - user + # returns user end def password=(password) check_password(password) set_password(password) - password + # returns password end def set_userinfo(user, password = nil) @@ -338,7 +338,7 @@ module URI def set_password(v) @password = v - v + # returns v end protected :set_password @@ -356,9 +356,9 @@ module URI private :escape_userpass def userinfo - if @user.nil? or @user.empty? + if @user.nil? nil - elsif @password.nil? or @password.empty? + elsif @password.nil? @user else @user + ':' + @password |
