Webfinger: Handle bogus ids better.

This commit is contained in:
lain 2020-08-25 17:35:59 +02:00
commit 112bec5225
2 changed files with 19 additions and 10 deletions

View file

@ -40,6 +40,11 @@ defmodule Pleroma.Web.WebFingerTest do
end
describe "fingering" do
test "returns error for nonsensical input" do
assert {:error, _} = WebFinger.finger("bliblablu")
assert {:error, _} = WebFinger.finger("pleroma.social")
end
test "returns error when fails parse xml or json" do
user = "invalid_content@social.heldscal.la"
assert {:error, %Jason.DecodeError{}} = WebFinger.finger(user)