mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@11750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e4e71a348
commit
ea51ff20ac
2 changed files with 13 additions and 6 deletions
|
@ -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>
|
Thu Feb 15 01:52:53 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm.(c|h), yarvcore.(c|h) (yarvGlobalStateVersion): rename to
|
* vm.(c|h), yarvcore.(c|h) (yarvGlobalStateVersion): rename to
|
||||||
|
|
|
@ -304,19 +304,19 @@ module URI
|
||||||
end
|
end
|
||||||
check_userinfo(*userinfo)
|
check_userinfo(*userinfo)
|
||||||
set_userinfo(*userinfo)
|
set_userinfo(*userinfo)
|
||||||
userinfo
|
# returns userinfo
|
||||||
end
|
end
|
||||||
|
|
||||||
def user=(user)
|
def user=(user)
|
||||||
check_user(user)
|
check_user(user)
|
||||||
set_user(user)
|
set_user(user)
|
||||||
user
|
# returns user
|
||||||
end
|
end
|
||||||
|
|
||||||
def password=(password)
|
def password=(password)
|
||||||
check_password(password)
|
check_password(password)
|
||||||
set_password(password)
|
set_password(password)
|
||||||
password
|
# returns password
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_userinfo(user, password = nil)
|
def set_userinfo(user, password = nil)
|
||||||
|
@ -338,7 +338,7 @@ module URI
|
||||||
|
|
||||||
def set_password(v)
|
def set_password(v)
|
||||||
@password = v
|
@password = v
|
||||||
v
|
# returns v
|
||||||
end
|
end
|
||||||
protected :set_password
|
protected :set_password
|
||||||
|
|
||||||
|
@ -356,9 +356,9 @@ module URI
|
||||||
private :escape_userpass
|
private :escape_userpass
|
||||||
|
|
||||||
def userinfo
|
def userinfo
|
||||||
if @user.nil? or @user.empty?
|
if @user.nil?
|
||||||
nil
|
nil
|
||||||
elsif @password.nil? or @password.empty?
|
elsif @password.nil?
|
||||||
@user
|
@user
|
||||||
else
|
else
|
||||||
@user + ':' + @password
|
@user + ':' + @password
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue