Pleroma.Signature: dialyzer error
lib/pleroma/signature.ex:30:pattern_match The pattern can never match the type. Pattern: %{<<97, 112, 95, 105, 100>> => _ap_id} Type: {:error, _} | {:ok, map()}
This commit is contained in:
parent
87cf7010fc
commit
1b40ebfa20
|
@ -27,7 +27,7 @@ def key_id_to_actor_id(key_id) do
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
case Pleroma.Web.WebFinger.finger(maybe_ap_id) do
|
case Pleroma.Web.WebFinger.finger(maybe_ap_id) do
|
||||||
%{"ap_id" => ap_id} -> {:ok, ap_id}
|
{:ok, %{"ap_id" => ap_id}} -> {:ok, ap_id}
|
||||||
_ -> {:error, maybe_ap_id}
|
_ -> {:error, maybe_ap_id}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -113,7 +113,7 @@ test "it deduces the actor id for gotoSocial" do
|
||||||
|
|
||||||
test "it calls webfinger for 'acct:' accounts" do
|
test "it calls webfinger for 'acct:' accounts" do
|
||||||
with_mock(Pleroma.Web.WebFinger,
|
with_mock(Pleroma.Web.WebFinger,
|
||||||
finger: fn _ -> %{"ap_id" => "https://gensokyo.2hu/users/raymoo"} end
|
finger: fn _ -> {:ok, %{"ap_id" => "https://gensokyo.2hu/users/raymoo"}} end
|
||||||
) do
|
) do
|
||||||
assert Signature.key_id_to_actor_id("acct:raymoo@gensokyo.2hu") ==
|
assert Signature.key_id_to_actor_id("acct:raymoo@gensokyo.2hu") ==
|
||||||
{:ok, "https://gensokyo.2hu/users/raymoo"}
|
{:ok, "https://gensokyo.2hu/users/raymoo"}
|
||||||
|
|
Loading…
Reference in New Issue