diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-31 04:39:45 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-31 04:39:45 +0000 |
commit | df86fe489e88eada04009c19380038afd2cdcb8e (patch) | |
tree | 3a51ace54c63ea6f484ef8efa28baa6ee371d660 /lib | |
parent | 183aa799e0c1d88ac3cdc008884bbbc0a419a77c (diff) | |
download | ruby-df86fe489e88eada04009c19380038afd2cdcb8e.tar.gz ruby-df86fe489e88eada04009c19380038afd2cdcb8e.tar.xz ruby-df86fe489e88eada04009c19380038afd2cdcb8e.zip |
* lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improve
for the value of IPv6 address in the Host: header field.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/httprequest.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index 33dafa93b..80188b8cf 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -253,7 +253,8 @@ module WEBrick uri = URI::parse(str) return uri if uri.absolute? if self["host"] - host, port = self['host'].split(":", 2) + pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/n + host, port = *self['host'].scan(pattern)[0] elsif @addr.size > 0 host, port = @addr[2], @addr[1] else |