Use encode16(case: :lower)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
8eca6ca87c
commit
e4f2f0994c
2 changed files with 2 additions and 2 deletions
|
|
@ -78,6 +78,6 @@ defmodule Pleroma.Webhook.Notify do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp signature(body, secret) do
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ defmodule Pleroma.Webhook.NotifyTest do
|
||||||
{"X-Hub-Signature", "sha256=" <> signature} =
|
{"X-Hub-Signature", "sha256=" <> signature} =
|
||||||
Enum.find(headers, fn {key, _} -> key == "X-Hub-Signature" end)
|
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: ""}
|
%Tesla.Env{status: 200, body: ""}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue