Zensavona / domainatrex

:smiling_imp: A library for parsing TLDs from urls in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails on a domain suffix of length 6 at dominatrex.ex:73

x-ji opened this issue · comments

The case statement at

case length(suffix) do
covers domain suffixes up to length 5, but apparently now the list fetched at https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat contains a domain suffix of length 6 (.design), and this causes dominatrex to fail to compile:

==> domainatrex
Compiling 1 file (.ex)

== Compilation error in file lib/domainatrex.ex ==
** (CaseClauseError) no case clause matching: 6
    lib/domainatrex.ex:73: anonymous fn/1 in :elixir_compiler_1.__MODULE__/1
    (elixir 1.15.5) lib/enum.ex:984: Enum."-each/2-lists^foreach/1-0-"/2
    lib/domainatrex.ex:71: (module)

A workaround for now is to add config :domainatrex, fetch_latest: false to your config.exs

It looks like the problem is related to this commit: publicsuffix/list@80a8ca1

This is fixed in 3.0.3

I'm seeing this issue on v3.0.3. It looks like it's complaining about 7 now.

#32 64.89 == Compilation error in file lib/domainatrex.ex ==
#32 64.89 ** (CaseClauseError) no case clause matching: 7
#32 64.89     lib/domainatrex.ex:73: anonymous fn/1 in :elixir_compiler_3.__MODULE__/1
#32 64.89     (elixir 1.15.7) lib/enum.ex:984: Enum."-each/2-lists^foreach/1-0-"/2
#32 64.89     lib/domainatrex.ex:71: (module)