diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-13 05:48:58 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-13 05:48:58 +0000 |
commit | 1a7cb01d6410dc7c56b46ef51b188bdf87b5fd4c (patch) | |
tree | 9d7108ce6de0b46c0fe7dab59edee2551b76c702 /lib/net/http.rb | |
parent | e502549be1bea41406ccef0e819b0e9cb8cdb069 (diff) |
aamine
* lib/net/http.rb: add HTTPRequest#basic_auth.
* lib/net/smtp.rb: raise if only account or password is given.
* lib/net/protocol.rb: WriteAdapter#<< returns self.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r-- | lib/net/http.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 473cf5d8a3..bbe98274f4 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -504,7 +504,10 @@ module Net end def self.get_print( addr, path, port = nil ) - print get( addr, path, port ) + new( addr, port || HTTP.port ).start {|http| + http.get path, nil, $stdout + } + nil end @@ -733,7 +736,7 @@ module Net end def basic_auth( acc, pass ) - @header['authorization'] = ["#{acc}:#{pass}"].pack('m').gsub(/\s+/, '') + @header['authorization'] = 'Basic ' + ["#{acc}:#{pass}"].pack('m').strip end end |