diff --git a/src/psl.c b/src/psl.c index c05c795..18a71c5 100644 --- a/src/psl.c +++ b/src/psl.c @@ -261,6 +261,9 @@ int psl_is_public(const psl_ctx_t *psl, const char *domain) if (rule) { // definitely a match, no matter if the found rule is a wildcard or not return 0; + } else if (suffix.nlabels == 1) { + // unknown TLD, this is the prevailing '*' match + return 0; } label_bak = suffix.label; diff --git a/tests/test-registrable-domain.c b/tests/test-registrable-domain.c index b57ee6a..8534ea9 100644 --- a/tests/test-registrable-domain.c +++ b/tests/test-registrable-domain.c @@ -123,14 +123,6 @@ static void test_psl(void) if (*p > 0 && isupper(*p)) *p = tolower(*p); - // there are test cases with 'example' unlisted TLD, unsure how to handle these, so skip for the moment - { - size_t len; - - if ((len = strlen(domain)) >= 7 && !strcmp(domain + len - 7, "example")) - continue; - } - if (!strcmp(expected_regdom, "null")) test(psl, domain, NULL); else