From df86fe489e88eada04009c19380038afd2cdcb8e Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Mon, 31 Jul 2006 04:39:45 +0000 Subject: * 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 --- lib/webrick/httprequest.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/webrick') 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 -- cgit