mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 02:49:18 +00:00
Correct behaviour of mediaproxy blocklist
This commit is contained in:
parent
8fe29bf5d2
commit
c8904f15a2
|
@ -84,8 +84,13 @@ def whitelisted?(url) do
|
|||
end
|
||||
|
||||
def blocked?(url) do
|
||||
%{host: domain} = URI.parse(url)
|
||||
domain in Config.get([:media_proxy, :whitelist])
|
||||
%{scheme: scheme, host: domain} = URI.parse(url)
|
||||
# Block either the bare domain or the scheme-domain combo
|
||||
scheme_domain = "#{scheme}://#{domain}"
|
||||
blocklist = Config.get([:media_proxy, :blocklist])
|
||||
|
||||
Enum.member?(blocklist, domain) ||
|
||||
Enum.member?(blocklist, scheme_domain)
|
||||
end
|
||||
|
||||
defp maybe_get_domain_from_url("http" <> _ = url) do
|
||||
|
|
Loading…
Reference in a new issue