X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fwebsub%2Fwebsub_controller.ex;h=1ad18a8a4edad84fae8252a4ca5b266b6a62096e;hb=06c4935c11fc58f5ede18706bc46dcc502e64052;hp=27304d988c5b3dffcf3c33bcea85d29c98a6582b;hpb=ede3fd7459c437af19a736622e09d68d4b7acf61;p=akkoma diff --git a/lib/pleroma/web/websub/websub_controller.ex b/lib/pleroma/web/websub/websub_controller.ex index 27304d988..1ad18a8a4 100644 --- a/lib/pleroma/web/websub/websub_controller.ex +++ b/lib/pleroma/web/websub/websub_controller.ex @@ -4,9 +4,13 @@ defmodule Pleroma.Web.Websub.WebsubController do use Pleroma.Web, :controller - alias Pleroma.{Repo, User} - alias Pleroma.Web.{Websub, Federator} + + alias Pleroma.Repo + alias Pleroma.User + alias Pleroma.Web.Websub + alias Pleroma.Web.Federator alias Pleroma.Web.Websub.WebsubClientSubscription + require Logger plug( @@ -67,6 +71,13 @@ defmodule Pleroma.Web.Websub.WebsubController do end end + def websub_subscription_confirmation(conn, params) do + Logger.info("Invalid WebSub confirmation request: #{inspect(params)}") + + conn + |> send_resp(500, "Invalid parameters") + end + def websub_incoming(conn, %{"id" => id}) do with "sha1=" <> signature <- hd(get_req_header(conn, "x-hub-signature")), signature <- String.downcase(signature),