From: lain Date: Sat, 24 Feb 2018 17:47:08 +0000 (+0100) Subject: Better signature errors messages. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=59ad395ffa7def7e1dea782120a107c91b4f4746;p=akkoma Better signature errors messages. --- diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex index a8dfccc40..4d0d900ac 100644 --- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex +++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@ -34,9 +34,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do end def inbox(conn, params) do - Logger.info("Signature error.") - Logger.info("Could not validate #{params["actor"]}") - Logger.info(inspect(conn.req_headers)) + if !(String.contains(conn.req_headers["signature"] || "", params["actor"])) do + Logger.info("Signature not from author, relayed message, ignoring.") + else + Logger.info("Signature error.") + Logger.info("Could not validate #{params["actor"]}") + Logger.info(inspect(conn.req_headers)) + end + json(conn, "ok") end