summaryrefslogtreecommitdiff
path: root/lib/net/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r--lib/net/http.rb7
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