Better signature errors messages.

This commit is contained in:
lain 2018-02-24 18:47:08 +01:00
parent 13ea3eafe5
commit 59ad395ffa
1 changed files with 8 additions and 3 deletions

View File

@ -34,9 +34,14 @@ def inbox(%{assigns: %{valid_signature: true}} = conn, params) do
end end
def inbox(conn, params) do def inbox(conn, params) do
Logger.info("Signature error.") if !(String.contains(conn.req_headers["signature"] || "", params["actor"])) do
Logger.info("Could not validate #{params["actor"]}") Logger.info("Signature not from author, relayed message, ignoring.")
Logger.info(inspect(conn.req_headers)) else
Logger.info("Signature error.")
Logger.info("Could not validate #{params["actor"]}")
Logger.info(inspect(conn.req_headers))
end
json(conn, "ok") json(conn, "ok")
end end