Use encode16(case: :lower)

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk 2026-02-27 23:13:15 +01:00
commit e4f2f0994c
2 changed files with 2 additions and 2 deletions

View file

@ -78,6 +78,6 @@ defmodule Pleroma.Webhook.Notify do
end
defp signature(body, secret) do
:crypto.mac(:hmac, :sha256, secret, body) |> Base.encode16()
:crypto.mac(:hmac, :sha256, secret, body) |> Base.encode16(case: :lower)
end
end

View file

@ -66,7 +66,7 @@ defmodule Pleroma.Webhook.NotifyTest do
{"X-Hub-Signature", "sha256=" <> signature} =
Enum.find(headers, fn {key, _} -> key == "X-Hub-Signature" end)
assert signature == :crypto.mac(:hmac, :sha256, secret, body) |> Base.encode16()
assert signature == :crypto.mac(:hmac, :sha256, secret, body) |> Base.encode16(case: :lower)
%Tesla.Env{status: 200, body: ""}
end)