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 | 0f66a9142fc880c0483d62ba0e1632c37fd27764 (patch) | |
| tree | 02affb811ce8bdf29671652af598ef30d500621f /lib | |
| parent | 1efbe32d1c103b1f088916d09f164fa6b3dc6368 (diff) | |
| download | ruby-0f66a9142fc880c0483d62ba0e1632c37fd27764.tar.gz ruby-0f66a9142fc880c0483d62ba0e1632c37fd27764.tar.xz ruby-0f66a9142fc880c0483d62ba0e1632c37fd27764.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/branches/ruby_1_8@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 297866f47..1d32293a2 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -256,7 +256,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 |
