Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Parsing DATABASE_URI, use URI#hostname: it's smarter about IPv6

Fixes #15705.

Conflicts:
	activerecord/lib/active_record/connection_adapters/connection_specification.rb
	activerecord/test/cases/connection_adapters/connection_handler_test.rb
  • Loading branch information...
commit 1c2f52175008ffd4c31338138f5b11bff677123b 1 parent d0e7f33
@matthewd matthewd authored
View
7 activerecord/CHANGELOG.md
@@ -1,3 +1,10 @@
+* Correctly extract IPv6 addresses from `DATABASE_URI`: the square brackets
+ are part of the URI structure, not the actual host.
+
+ Fixes #15705.
+
+ *Andy Bakun*, *Aaron Stone*
+
* Don't error when quoting user defined types in PostgreSQL.
Fixes #15697.
View
2  activerecord/lib/active_record/connection_adapters/connection_specification.rb
@@ -74,7 +74,7 @@ def connection_url_to_hash(url) # :nodoc:
:password => config.password,
:port => config.port,
:database => config.path.sub(%r{^/},""),
- :host => config.host }
+ :host => config.hostname }
spec.reject!{ |_,value| value.blank? }
Please sign in to comment.
Something went wrong with that request. Please try again.