0
0
Fork 0

Fix installation failing when Redis password contains special characters (#13156)

* Add support for special characters in Redis passwords

Fixes #13154

* Refactor
This commit is contained in:
ThibG 2020-02-29 03:00:43 +01:00 committed by GitHub
parent 047fde18c3
commit ce17cea221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -14,7 +14,9 @@ def setup_redis_env_url(prefix = nil, defaults = true)
ENV[prefix + 'REDIS_URL'] = if [password, host, port, db].all?(&:nil?)
ENV['REDIS_URL']
else
"redis://#{password.blank? ? '' : ":#{password}@"}#{host}:#{port}/#{db}"
Addressable::URI.parse("redis://#{host}:#{port}/#{db}").tap do |uri|
uri.password = password if password.present?
end.normalize.to_str
end
end