aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_cloak_sha256.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-06-05 01:29:14 +0100
committerGravatar Sadie Powell2023-06-05 11:13:25 +0100
commit2d029f348a76d70be05c2dbf598ec9d8ea3529e0 (patch)
treed5972e1440d7462be34f9594ffb95b7a7e07155f /src/modules/m_cloak_sha256.cpp
parentFix commands overflowing the message size in `/STATS Oo`. (diff)
Try to cloak with the registerable suffix first with PSL cloaking.
Diffstat (limited to 'src/modules/m_cloak_sha256.cpp')
-rw-r--r--src/modules/m_cloak_sha256.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}