From 59ad395ffa7def7e1dea782120a107c91b4f4746 Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 24 Feb 2018 18:47:08 +0100 Subject: [PATCH] Better signature errors messages. --- .../web/activity_pub/activity_pub_controller.ex | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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