* 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
This commit is contained in:
parent
1e41cf4885
commit
bcbdd1f660
@ -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>
|
Wed Feb 14 00:30:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (init_unixsock): path may contain NUL for
|
* ext/socket/socket.c (init_unixsock): path may contain NUL for
|
||||||
|
@ -337,7 +337,7 @@ module URI
|
|||||||
protected :set_user
|
protected :set_user
|
||||||
|
|
||||||
def set_password(v)
|
def set_password(v)
|
||||||
set_userinfo(@user, v)
|
@password = v
|
||||||
v
|
v
|
||||||
end
|
end
|
||||||
protected :set_password
|
protected :set_password
|
||||||
@ -356,7 +356,9 @@ module URI
|
|||||||
private :escape_userpass
|
private :escape_userpass
|
||||||
|
|
||||||
def userinfo
|
def userinfo
|
||||||
if !@password
|
if @user.nil? or @user.empty?
|
||||||
|
nil
|
||||||
|
elsif @password.nil? or @password.empty?
|
||||||
@user
|
@user
|
||||||
else
|
else
|
||||||
@user + ':' + @password
|
@user + ':' + @password
|
||||||
|
Loading…
x
Reference in New Issue
Block a user