From 2d029f348a76d70be05c2dbf598ec9d8ea3529e0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 5 Jun 2023 01:29:14 +0100 Subject: Try to cloak with the registerable suffix first with PSL cloaking. --- src/modules/m_cloak_sha256.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_cloak_sha256.cpp b/src/modules/m_cloak_sha256.cpp index a269048da..92e3ca964 100644 --- a/src/modules/m_cloak_sha256.cpp +++ b/src/modules/m_cloak_sha256.cpp @@ -148,7 +148,9 @@ private: if (psl && separator == '.') { // Attempt to look up the suffix with libpsl. - const char* publicsuffix = psl_unregistrable_domain(psl, host.c_str()); + const char* publicsuffix = psl_registrable_domain(psl, host.c_str()); + if (!publicsuffix || publicsuffix == host) + publicsuffix = psl_unregistrable_domain(psl, host.c_str()); if (publicsuffix && publicsuffix != host) visiblepart = publicsuffix; } -- cgit v1.3.1-10-gc9f91