Don't try to convert data URIs to data URIs

This commit is contained in:
Shadowfacts 2021-09-22 19:46:07 -04:00
parent 1c2ef3bc51
commit 6916647737
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 0 deletions

View File

@ -152,6 +152,10 @@ defmodule Frenzy.Pipeline.ScrapeStage do
@content_type_allowlist ["image/jpeg", "image/png", "image/heic", "image/heif", "image/tiff"] @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 # 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 defp image_to_data_uri(src, site_uri, true) do
absolute_url = URI.merge(site_uri, src) |> to_string() absolute_url = URI.merge(site_uri, src) |> to_string()