diff options
author | Mark Felder <feld@feld.me> | 2024-01-26 19:09:38 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-01-26 21:03:23 -0500 |
commit | 87cf7010fc865f37f518d51e9b41e91cb0524bbe (patch) | |
tree | 7b2e1ea8355f7b26919fecb55e6cf38dfcf42da3 | |
parent | 06b8923d4222b617aeeffd507aa2bf7aa5943de1 (diff) | |
download | pleroma-87cf7010fc865f37f518d51e9b41e91cb0524bbe.tar.gz pleroma-87cf7010fc865f37f518d51e9b41e91cb0524bbe.zip |
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()
-rw-r--r-- | lib/pleroma/upload.ex | 2 |
1 files changed, 1 insertions, 1 deletions
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/(?<filetype>jpeg|png|gif);base64,(?<data>.*)/, 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), |