aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/url.rb
diff options
context:
space:
mode:
authorBrian Weaver <cmdrclueless@gmail.com>2015-04-16 16:20:57 -0400
committerBrian Weaver <cmdrclueless@gmail.com>2015-04-16 20:57:31 -0400
commitc4a83b5454a3516b630b38cd8e8472f2166fc986 (patch)
treecb6ea4fed8e01d6652a2c19b2882f42f55e2c341 /actionpack/lib/action_dispatch/http/url.rb
parentc8bab30ce5a7a40be7a3c7c4271e8ae6d2b303bb (diff)
downloadrails-c4a83b5454a3516b630b38cd8e8472f2166fc986.tar.gz
rails-c4a83b5454a3516b630b38cd8e8472f2166fc986.tar.bz2
rails-c4a83b5454a3516b630b38cd8e8472f2166fc986.zip
Fix broken IPv6 addresses handling
Diffstat (limited to 'actionpack/lib/action_dispatch/http/url.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index f5b709ccd6..350ef147e0 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -5,7 +5,7 @@ module ActionDispatch
module Http
module URL
IP_HOST_REGEXP = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
- HOST_REGEXP = /(^[^:]+:\/\/)?([^:]+)(?::(\d+$))?/
+ HOST_REGEXP = /(^[^:]+:\/\/)?(\[[^\]]+\]|[^:]+)(?::(\d+$))?/
PROTOCOL_REGEXP = /^([^:]+)(:)?(\/\/)?$/
mattr_accessor :tld_length