From 87cf7010fc865f37f518d51e9b41e91cb0524bbe Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 26 Jan 2024 19:09:38 -0500 Subject: [PATCH] Pleroma.Upload: dialyzer error I have opted to set this to :upper as this retains the same behavior but clears up the error. lib/pleroma/upload.ex:178:call The function call will not succeed. Base.encode16(binary(), [{:lower, true}]) breaks the contract (binary(), [{:case, encode_case()}]) :: binary() --- lib/pleroma/upload.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 3c355e64d..89cd3d920 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -175,7 +175,7 @@ defmodule Pleroma.Upload do defp prepare_upload(%{img: "data:image/" <> image_data}, opts) do parsed = Regex.named_captures(~r/(?jpeg|png|gif);base64,(?.*)/, image_data) data = Base.decode64!(parsed["data"], ignore: :whitespace) - hash = Base.encode16(:crypto.hash(:sha256, data), lower: true) + hash = Base.encode16(:crypto.hash(:sha256, data), case: :upper) with :ok <- check_binary_size(data, opts.size_limit), tmp_path <- tempfile_for_image(data),