Skip to content

Commit

Permalink
config check should suffice
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Apr 30, 2024
1 parent e997e6d commit 3e0680c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/dotcom_web/controllers/static_file_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule DotcomWeb.StaticFileController do
end

def send_file(conn) do
full_url = cms_api_base_url() <> conn.request_path
full_url = Application.get_env(:dotcom, :cms_api)[:base_url] <> conn.request_path

forward_static_file(conn, full_url)
end
Expand All @@ -22,12 +22,4 @@ defmodule DotcomWeb.StaticFileController do
|> put_status(301)
|> redirect(external: url)
end

defp cms_api_base_url() do
if config = Application.get_env(:dotcom, :cms_api) do
config[:base_url]
else
Application.get_env(:dotcom, :drupal)[:cms_root]
end
end
end

0 comments on commit 3e0680c

Please sign in to comment.