1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-17 18:49:15 +00:00

Fix broken Rich Media parsing when the image URL is a relative path

This commit is contained in:
Mark Felder 2024-03-07 14:19:03 -05:00 committed by Floatingghost
parent 765c7e98d2
commit 4746f98851

View file

@ -22,7 +22,8 @@ def ttl(data, _url) do
defp is_aws_signed_url(image) when is_binary(image) and image != "" do defp is_aws_signed_url(image) when is_binary(image) and image != "" do
%URI{host: host, query: query} = URI.parse(image) %URI{host: host, query: query} = URI.parse(image)
String.contains?(host, "amazonaws.com") and String.contains?(query, "X-Amz-Expires") is_binary(host) and String.contains?(host, "amazonaws.com") and
String.contains?(query, "X-Amz-Expires")
end end
defp is_aws_signed_url(_), do: nil defp is_aws_signed_url(_), do: nil