projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[#3213] ActivityPub: implemented subqueries-based hashtags filtering, removed aggrega...
[akkoma]
/
lib
/
pleroma
/
web
/
media_proxy.ex
diff --git
a/lib/pleroma/web/media_proxy.ex
b/lib/pleroma/web/media_proxy.ex
index 1dab35d2ca952d749e0ccf866d8a295cd90b2369..27f3371389edbb5178e5b6435f746b2d19c65be6 100644
(file)
--- a/
lib/pleroma/web/media_proxy.ex
+++ b/
lib/pleroma/web/media_proxy.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MediaProxy do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MediaProxy do
@@
-73,22
+73,14
@@
defmodule Pleroma.Web.MediaProxy do
def whitelisted?(url) do
%{host: domain} = URI.parse(url)
def whitelisted?(url) do
%{host: domain} = URI.parse(url)
- %{host: web_domain} = Web.base_url() |> URI.parse()
- %{host: upload_domain} = Upload.base_url() |> URI.parse()
mediaproxy_whitelist_domains =
[:media_proxy, :whitelist]
|> Config.get()
mediaproxy_whitelist_domains =
[:media_proxy, :whitelist]
|> Config.get()
+ |> Kernel.++(["#{Upload.base_url()}"])
|> Enum.map(&maybe_get_domain_from_url/1)
|> Enum.map(&maybe_get_domain_from_url/1)
- whitelist_domains =
- if web_domain == upload_domain do
- mediaproxy_whitelist_domains
- else
- [upload_domain | mediaproxy_whitelist_domains]
- end
-
- domain in whitelist_domains
+ domain in mediaproxy_whitelist_domains
end
defp maybe_get_domain_from_url("http" <> _ = url) do
end
defp maybe_get_domain_from_url("http" <> _ = url) do