From dadca65c4aaee629d241ceb01c590e57ecc97453 Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Tue, 24 Dec 2024 10:53:37 +0700 Subject: [PATCH] Add guard for hosts validation --- lib/uplink/caddy/config/hosts.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/uplink/caddy/config/hosts.ex b/lib/uplink/caddy/config/hosts.ex index 8e8f458..ee20193 100644 --- a/lib/uplink/caddy/config/hosts.ex +++ b/lib/uplink/caddy/config/hosts.ex @@ -6,9 +6,10 @@ defmodule Uplink.Caddy.Config.Hosts do def routable?(%{ metadata: %Metadata{ - main_port: %{routing: %Port.Routing{}} + main_port: %{routing: %Port.Routing{hosts: hosts}} } - }), + }) + when length(hosts) > 0, do: true def routable?(%{metadata: %Metadata{hosts: hosts}}) when length(hosts) > 0,