File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ * Support IPv6 URLs.
3
4
* Add ` Redis#with ` for better compatibility with ` connection_pool ` usage.
4
5
* Fix the block form of ` multi ` called inside ` pipelined ` . Previously the ` MUTLI/EXEC ` wouldn't be sent. See #1073 .
5
6
Original file line number Diff line number Diff line change @@ -464,7 +464,7 @@ def _parse_options(options)
464
464
defaults [ :path ] = uri . path
465
465
when "redis" , "rediss"
466
466
defaults [ :scheme ] = uri . scheme
467
- defaults [ :host ] = uri . host if uri . host
467
+ defaults [ :host ] = uri . host . sub ( / \A \[ (.*) \] \z / , '\1' ) if uri . host
468
468
defaults [ :port ] = uri . port if uri . port
469
469
defaults [ :username ] = CGI . unescape ( uri . user ) if uri . user && !uri . user . empty?
470
470
defaults [ :password ] = CGI . unescape ( uri . password ) if uri . password && !uri . password . empty?
Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ def test_defaults_to_localhost
135
135
assert_equal "127.0.0.1" , redis . _client . host
136
136
end
137
137
138
+ def test_ipv6_url
139
+ redis = Redis . new url : "redis://[::1]"
140
+
141
+ assert_equal "::1" , redis . _client . host
142
+ end
143
+
138
144
def test_user_and_password
139
145
redis = Redis . new ( url :
'redis://johndoe:[email protected] :999/2' )
140
146
You can’t perform that action at this time.
0 commit comments