Allow specifying multiple hosts for kamal proxy via an array

This commit is contained in:
Dmytro Shteflyuk
2024-09-28 20:04:34 -04:00
parent f331605efa
commit 1d48a0fb0a
6 changed files with 42 additions and 5 deletions

View File

@@ -13,6 +13,16 @@ class ConfigurationProxyTest < ActiveSupport::TestCase
assert_equal true, config.proxy.ssl?
end
test "ssl with multiple hosts passed via host" do
@deploy[:proxy] = { "ssl" => true, "host" => "example.com,anotherexample.com" }
assert_equal true, config.proxy.ssl?
end
test "ssl with multiple hosts passed via hosts" do
@deploy[:proxy] = { "ssl" => true, "hosts" => [ "example.com", "anotherexample.com" ] }
assert_equal true, config.proxy.ssl?
end
test "ssl with no host" do
@deploy[:proxy] = { "ssl" => true }
assert_raises(Kamal::ConfigurationError) { config.proxy.ssl? }