aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-08 05:24:47 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-08 05:24:47 +0000
commit992d2749aca335795b6cd943bf4025f5ff281699 (patch)
treedc84db72a47197149779a9976bb9e02d8178caf9
parentc5c6516c2d30704e1d9092f708dbbbcb8e161707 (diff)
downloadruby-992d2749aca335795b6cd943bf4025f5ff281699.tar.gz
* lib/net/http.rb (HTTP#request): should not overwrite Connection header. (ruby-bugs:PR#1274)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/http.rb20
2 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e16eecbc8..4ba69e05b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 8 14:24:35 2004 Minero Aoki <aamine@loveruby.net>
+
+ * lib/net/http.rb (HTTP#request): should not overwrite Connection
+ header. (ruby-bugs:PR#1274)
+
Sat Feb 8 10:11:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (glob_helper): Dir.glob('**/') did not work. [ruby-dev:22832]
diff --git a/lib/net/http.rb b/lib/net/http.rb
index c39a1f8f1f..6e0e7e03ab 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -48,9 +48,9 @@ module Net # :nodoc:
# (formal version)
#
# require 'net/http'
- # Net::HTTP.start('www.example.com', 80) { |http|
- # response = http.get('/index.html')
- # puts response.body
+ # Net::HTTP.start('www.example.com', 80) {|http|
+ # response = http.get('/index.html')
+ # puts response.body
# }
#
# (shorter version)
@@ -67,8 +67,8 @@ module Net # :nodoc:
# === Posting Form Data
#
# require 'net/http'
- # Net::HTTP.start('some.www.server', 80) { |http|
- # response = http.post('/cgi-bin/search.rb', 'query=ruby')
+ # Net::HTTP.start('some.www.server', 80) {|http|
+ # response = http.post('/cgi-bin/search.rb', 'query=ruby')
# }
#
# === Accessing via Proxy
@@ -83,7 +83,7 @@ module Net # :nodoc:
# proxy_port = 8080
# :
# Net::HTTP::Proxy(proxy_addr, proxy_port).start('www.example.com') {|http|
- # # always connect to your.proxy.addr:8080
+ # # always connect to your.proxy.addr:8080
# :
# }
#
@@ -160,13 +160,13 @@ module Net # :nodoc:
# allows you to use 1.2 features again.
#
# # example
- # Net::HTTP.start { |http1| ...(http1 has 1.2 features)... }
+ # Net::HTTP.start {|http1| ...(http1 has 1.2 features)... }
#
# Net::HTTP.version_1_1
- # Net::HTTP.start { |http2| ...(http2 has 1.1 features)... }
+ # Net::HTTP.start {|http2| ...(http2 has 1.1 features)... }
#
# Net::HTTP.version_1_2
- # Net::HTTP.start { |http3| ...(http3 has 1.2 features)... }
+ # Net::HTTP.start {|http3| ...(http3 has 1.2 features)... }
#
# This function is NOT thread-safe.
#
@@ -819,7 +819,7 @@ module Net # :nodoc:
def request(req, body = nil, &block) # :yield: +response+
unless started?
start {
- req['connection'] = 'close'
+ req['connection'] ||= 'close'
return request(req, body, &block)
}
end