mediaproxy: proxy network-path references
Discovered-by: snow Fixes: https://akkoma.dev/AkkomaGang/akkoma/issues/900 (cherry picked from commit bbf974adc82d09a2099fb1234729131929307911)
This commit is contained in:
parent
c2bdfb6a34
commit
5cd6894a66
4 changed files with 63 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ defmodule Pleroma.Web.MediaProxy do
|
|||
end
|
||||
|
||||
def url(url) when is_nil(url) or url == "", do: nil
|
||||
def url("//" <> _ = url), do: url("https:" <> url)
|
||||
def url("/" <> _ = url), do: url
|
||||
|
||||
def url(url) do
|
||||
|
|
@ -56,7 +57,10 @@ defmodule Pleroma.Web.MediaProxy do
|
|||
not local?(url) and not whitelisted?(url)
|
||||
end
|
||||
|
||||
def preview_url(url, preview_params \\ []) do
|
||||
def preview_url(url, preview_params \\ [])
|
||||
def preview_url("//" <> _ = url, pparams), do: preview_url("https:" <> url, pparams)
|
||||
|
||||
def preview_url(url, preview_params) do
|
||||
if preview_enabled?() do
|
||||
encode_preview_url(url, preview_params)
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue