aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/websub/websub.ex6
-rw-r--r--lib/pleroma/web/websub/websub_controller.ex7
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex
index 3a287edd9..7ca62c83b 100644
--- a/lib/pleroma/web/websub/websub.ex
+++ b/lib/pleroma/web/websub/websub.ex
@@ -121,6 +121,12 @@ defmodule Pleroma.Web.Websub do
end
end
+ def incoming_subscription_request(user, params) do
+ Logger.info("Unhandled WebSub request for #{user.nickname}: #{inspect(params)}")
+
+ {:error, "Invalid WebSub request"}
+ end
+
defp get_subscription(topic, callback) do
Repo.get_by(WebsubServerSubscription, topic: topic, callback: callback) ||
%WebsubServerSubscription{}
diff --git a/lib/pleroma/web/websub/websub_controller.ex b/lib/pleroma/web/websub/websub_controller.ex
index 27304d988..e58f144e5 100644
--- a/lib/pleroma/web/websub/websub_controller.ex
+++ b/lib/pleroma/web/websub/websub_controller.ex
@@ -67,6 +67,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),