Don't validate on missing public key.

This commit is contained in:
lain 2018-03-11 14:47:37 +01:00
parent a9f78fe8e0
commit 368e085144
3 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,7 @@ defmodule Pleroma.Web.HTTPSignatures do
else else
e -> e ->
Logger.debug("Could not public key!") Logger.debug("Could not public key!")
false
end end
end end

View File

@ -401,6 +401,13 @@ defmodule HTTPoisonMock do
}} }}
end end
def get("https://mst3k.interlinked.me/users/luciferMysticus", ["Accept": "application/activity+json"], _) do
{:ok, %Response{
status_code: 200,
body: File.read!("test/fixtures/httpoison_mock/lucifermysticus.json")
}}
end
def get("https://mstdn.io/users/mayuutann", ["Accept": "application/activity+json"], _) do def get("https://mstdn.io/users/mayuutann", ["Accept": "application/activity+json"], _) do
{:ok, %Response{ {:ok, %Response{
status_code: 200, status_code: 200,

View File

@ -183,6 +183,7 @@ defmodule Pleroma.Web.HTTPSignaturesTest do
{"(request-target)", "post /inbox"} {"(request-target)", "post /inbox"}
] ]
} }
assert HTTPSignatures.validate_conn(conn) assert HTTPSignatures.validate_conn(conn)
end end
end end