summaryrefslogtreecommitdiff
path: root/lib/net/http.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-05 08:53:06 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-05 08:53:06 +0000
commit2a34f89e354071d09c64a93bf3498dfa108f3e8c (patch)
tree7694c6a0564b641378b9ca8f413935ef366866de /lib/net/http.rb
parentfedf48986da718580062d081dda38c4ee182c254 (diff)
protocol.rb version 1.1.17
o http.rb: 'Host:' field includes port if port != 80 o http.rb: see also 'proxy-connection:' field git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r--lib/net/http.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 4e284a5af4..2a7190f126 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -420,7 +420,11 @@ All "key" is case-insensitive.
@http_version = HTTPVersion
@in_header = {}
- @in_header[ 'Host' ] = sock.addr
+ if sock.port == HTTP.port
+ @in_header[ 'Host' ] = sock.addr
+ else
+ @in_header[ 'Host' ] = sock.addr + ':' + sock.port
+ end
@in_header[ 'Connection' ] = 'Keep-Alive'
@in_header[ 'Accept' ] = '*/*'
@@ -505,6 +509,12 @@ All "key" is case-insensitive.
if tmp and /close/i === tmp then
@socket.read_all dest
@socket.close
+ else
+ tmp = resp['proxy-connection']
+ if tmp and /close/i === tmp then
+ @socket.read_all dest
+ @socket.close
+ end
end
end
end