From 69166477373d8f971912e80152b6d8a3d860e4ef Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 22 Sep 2021 19:46:07 -0400 Subject: [PATCH] Don't try to convert data URIs to data URIs --- lib/frenzy/pipeline/scrape_stage.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/frenzy/pipeline/scrape_stage.ex b/lib/frenzy/pipeline/scrape_stage.ex index 39b9e9b..50292d4 100644 --- a/lib/frenzy/pipeline/scrape_stage.ex +++ b/lib/frenzy/pipeline/scrape_stage.ex @@ -152,6 +152,10 @@ defmodule Frenzy.Pipeline.ScrapeStage do @content_type_allowlist ["image/jpeg", "image/png", "image/heic", "image/heif", "image/tiff"] # convert images to data URIs so that they're stored by clients as part of the body + defp image_to_data_uri("data:" <> _ = src, _site_uri, _convert) do + src + end + defp image_to_data_uri(src, site_uri, true) do absolute_url = URI.merge(site_uri, src) |> to_string()