Skip to content

Commit

Permalink
Add guard for hosts validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Dec 24, 2024
1 parent f13b422 commit dadca65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/uplink/caddy/config/hosts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dadca65

Please sign in to comment.