|
|
|
@ -37,15 +37,15 @@ defmodule Pleroma.Web.MediaProxy do
|
|
|
|
|
def url("/" <> _ = url), do: url
|
|
|
|
|
|
|
|
|
|
def url(url) do
|
|
|
|
|
if disabled?() or not is_url_proxiable?(url) do
|
|
|
|
|
if disabled?() or not url_proxiable?(url) do
|
|
|
|
|
url
|
|
|
|
|
else
|
|
|
|
|
encode_url(url)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@spec is_url_proxiable?(String.t()) :: boolean()
|
|
|
|
|
def is_url_proxiable?(url) do
|
|
|
|
|
@spec url_proxiable?(String.t()) :: boolean()
|
|
|
|
|
def url_proxiable?(url) do
|
|
|
|
|
if local?(url) or whitelisted?(url) do
|
|
|
|
|
false
|
|
|
|
|
else
|
|
|
|
|