Change :sha to :checksum
authorEkaterina Vaartis <vaartis@cock.li>
Wed, 11 Sep 2019 18:43:16 +0000 (21:43 +0300)
committerEkaterina Vaartis <vaartis@cock.li>
Wed, 18 Sep 2019 21:16:33 +0000 (00:16 +0300)
lib/pleroma/web/emoji_api/emoji_api_controller.ex

index 1c5b7c687f1dd8223caa4b5c6485b04566a50ca5..0d4a17c616106f03d761bb672cc748783b487d1d 100644 (file)
@@ -183,7 +183,7 @@ keeping it in cache for #{div(cache_ms, 1000)}s")
 
     with {:ok, %{sha: sha, uri: uri} = pinfo} <- pack_info_res,
          %{body: emoji_archive} <- Tesla.get!(uri),
-         {_, true} <- {:sha, Base.decode16!(sha) == :crypto.hash(:sha256, emoji_archive)} do
+         {_, true} <- {:checksum, Base.decode16!(sha) == :crypto.hash(:sha256, emoji_archive)} do
       local_name = data["as"] || name
       pack_dir = Path.join(@emoji_dir_path, local_name)
       File.mkdir_p!(pack_dir)
@@ -207,7 +207,7 @@ keeping it in cache for #{div(cache_ms, 1000)}s")
       {:error, e} ->
         conn |> put_status(:internal_server_error) |> json(%{error: e})
 
-      {:sha, _} ->
+      {:checksum, _} ->
         conn
         |> put_status(:internal_server_error)
         |> json(%{error: "SHA256 for the pack doesn't match the one sent by the server"})