From 4746f98851c4bf71310b62bc3bb3d36be2656c36 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 7 Mar 2024 14:19:03 -0500 Subject: [PATCH] Fix broken Rich Media parsing when the image URL is a relative path --- lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex b/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex index 946c751c8..a3b259370 100644 --- a/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex +++ b/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex @@ -22,7 +22,8 @@ defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl do defp is_aws_signed_url(image) when is_binary(image) and image != "" do %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 defp is_aws_signed_url(_), do: nil