diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-05 08:53:06 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-05 08:53:06 +0000 |
| commit | a1b4737bf859b28857b5c4715348fc986ecbad80 (patch) | |
| tree | 7694c6a0564b641378b9ca8f413935ef366866de | |
| parent | 817a62de81d75c73cceb453301ef27b094f17c14 (diff) | |
| download | ruby-a1b4737bf859b28857b5c4715348fc986ecbad80.tar.gz ruby-a1b4737bf859b28857b5c4715348fc986ecbad80.tar.xz ruby-a1b4737bf859b28857b5c4715348fc986ecbad80.zip | |
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: http://svn.ruby-lang.org/repos/ruby/trunk@679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | lib/net/http.rb | 12 | ||||
| -rw-r--r-- | lib/net/protocol.rb | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 4e284a5af..2a7190f12 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 diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 81e8e987e..1d909bbb4 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -15,7 +15,7 @@ require 'socket' module Net - Version = '1.1.16' + Version = '1.1.17' =begin |
