Skip to content

Commit

Permalink
Forward static file requests to the CDN (#2045)
Browse files Browse the repository at this point in the history
* dev and prod behave differently

* unused var
  • Loading branch information
anthonyshull authored May 9, 2024
1 parent c46d70a commit 9a02331
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/cms/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ defmodule CMS.Api do

defp set_redirect_options(uri) do
base_url = Application.get_env(:dotcom, :cms_api)[:base_url]
file_path = "/sites/default/files"

if String.contains?(base_url, uri.host) and not String.contains?(uri.path, file_path) do
if String.contains?(base_url, uri.host) do
[to: uri |> internal_uri() |> parse_redirect_query()]
else
[external: parse_redirect_query(uri)]
Expand Down

0 comments on commit 9a02331

Please sign in to comment.