summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-15 07:43:37 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-15 07:43:37 +0000
commit8253888a7a4e4c574c2aaa96a2614bb0c741db71 (patch)
treef14f65367bd61a5d69bb7ab68eeac4c3909a70e3
parent24d4ba2a258d2cbbc8cd2a75496d5aae5f13d6b7 (diff)
downloadruby-8253888a7a4e4c574c2aaa96a2614bb0c741db71.tar.gz
ruby-8253888a7a4e4c574c2aaa96a2614bb0c741db71.tar.xz
ruby-8253888a7a4e4c574c2aaa96a2614bb0c741db71.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/trunk@11750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/uri/generic.rb12
2 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 5365351f1..1d16fff85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Feb 15 16:25:54 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * 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.
+
Thu Feb 15 01:52:53 2007 Koichi Sasada <ko1@atdot.net>
* vm.(c|h), yarvcore.(c|h) (yarvGlobalStateVersion): rename to
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