Skip to content

Commit 4343a30

Browse files
committed
Revert "quick fix for ".co.uk""
This reverts commit 8bae0a6.
1 parent cb896bb commit 4343a30

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/ret/media_resolver.ex

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -669,19 +669,10 @@ defmodule Ret.MediaResolver do
669669
nil
670670
end
671671

672-
defp get_root_host(host) do
673-
if String.ends_with?(host, ".co.uk") do
674-
host
675-
|> String.split(".")
676-
|> Enum.slice(-3..-1)
677-
|> Enum.join(".")
678-
else
679-
host
680-
|> String.split(".")
681-
|> Enum.slice(-2..-1)
682-
|> Enum.join(".")
672+
defp get_root_host(host) do
673+
# Drop subdomains
674+
host |> String.split(".") |> Enum.slice(-2..-1) |> Enum.join(".")
683675
end
684-
end
685676

686677
defp get_imgur_headers() do
687678
with client_id when is_binary(client_id) <- module_config(:imgur_client_id),

0 commit comments

Comments
 (0)