diff options
author | Mark Felder <feld@feld.me> | 2021-01-26 13:53:59 -0600 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-01-26 13:54:23 -0600 |
commit | bf15a1c7f3adeb39d098aed40e0e74fdc3090184 (patch) | |
tree | a5ac8d21b5cb8f5539210890c4760579c161465e /lib | |
parent | a55c6de32b9291fb2c3effdbc22d678a837aa0c2 (diff) | |
download | pleroma-bf15a1c7f3adeb39d098aed40e0e74fdc3090184.tar.gz |
Tiny safety net
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex b/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex index a119073eb..53113a282 100644 --- a/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex @@ -13,7 +13,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.DnsRblPolicy do # :nameserver is the RBL server we want to query rblhost = rblconfig[:nameserver] - + # We have to query the nameserver's by IP, so look it up if an IP address wasn't # provided in the config. # You may want this to be a hostname with round-robin A records for basic load @@ -34,7 +34,11 @@ defmodule Pleroma.Web.ActivityPub.MRF.DnsRblPolicy do rblzone = rblconfig[:zone] || rblhost # concatenate the host we're checking with the zone, e.g., "pleroma.host" <> . <> "bl.pleroma.com" <> . - query = (actor_host <> "." <> rblzone <> ".") |> String.to_charlist() + # trim off duplicate trailing period in case it was supplied in the config. + query = + (actor_host <> "." <> rblzone <> ".") + |> String.replace_suffix("..", ".") + |> String.to_charlist() # Timeout of 1s, retry 1 # We will only be using UDP for queries, so I think if the DNSRBL server is > 500ms away it won't work |