diff --git a/lib/beacon/private.ex b/lib/beacon/private.ex index 972a71cc..48bb28fb 100644 --- a/lib/beacon/private.ex +++ b/lib/beacon/private.ex @@ -52,19 +52,10 @@ defmodule Beacon.Private do Phoenix.LiveView.Route.live_link_info_without_checks(endpoint, router, url) end - def endpoint_config(otp_app, endpoint) do - Phoenix.Endpoint.Supervisor.config(otp_app, endpoint) + def endpoint_host(_otp_app, endpoint) do + endpoint.host() end - def endpoint_host(otp_app, endpoint) do - url_config = endpoint_config(otp_app, endpoint)[:url] - host_to_binary(url_config[:host] || "localhost") - end - - # https://github.com/phoenixframework/phoenix/blob/4ebefb9d1f710c576f08c517f5852498dd9b935c/lib/phoenix/endpoint/supervisor.ex#L301-L302 - defp host_to_binary({:system, env_var}), do: host_to_binary(System.get_env(env_var)) - defp host_to_binary(host), do: host - def router(%{private: %{phoenix_router: router}}), do: router @doc """ diff --git a/mix.exs b/mix.exs index 987cc99a..2997b393 100644 --- a/mix.exs +++ b/mix.exs @@ -69,7 +69,7 @@ defmodule Beacon.MixProject do {:ex_aws, "~> 2.4.0"}, {:ex_aws_s3, "~> 2.4.0"}, {:floki, ">= 0.30.0"}, - {:gettext, "~> 0.26"}, + {:gettext, "~> 0.26 or ~> 1.0"}, {:hackney, "~> 1.16"}, {:image, "~> 0.40"}, {:vix, "<= 0.30.0 or >= 0.31.1"},