projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in dev, allow dev FE
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf.ex
b/lib/pleroma/web/activity_pub/mrf.ex
index dae6d7f6a1ae74512336d46f2efd5e98fc6779f3..6ecd62c99e17f2ccbd4a0c0fb33bdb2050a34fbd 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf.ex
+++ b/
lib/pleroma/web/activity_pub/mrf.ex
@@
-161,10
+161,17
@@
defmodule Pleroma.Web.ActivityPub.MRF do
# - https://extra.baddomain.net/
# Does NOT match the following:
# - https://maybebaddomain.net/
# - https://extra.baddomain.net/
# Does NOT match the following:
# - https://maybebaddomain.net/
+
+ # *.baddomain.net
def subdomain_regex("*." <> domain), do: subdomain_regex(domain)
def subdomain_regex("*." <> domain), do: subdomain_regex(domain)
+ # baddomain.net
def subdomain_regex(domain) do
def subdomain_regex(domain) do
- ~r/^(.+\.)?#{Regex.escape(domain)}$/i
+ if String.ends_with?(domain, ".*") do
+ ~r/^(.+\.)?#{Regex.escape(String.replace_suffix(domain, ".*", ""))}\.(.+)$/i
+ else
+ ~r/^(.+\.)?#{Regex.escape(domain)}$/i
+ end
end
@spec subdomains_regex([String.t()]) :: [Regex.t()]
end
@spec subdomains_regex([String.t()]) :: [Regex.t()]