[#534] Refactoring / tweaks per MR review.
This commit is contained in:
parent
d99650270b
commit
9560abea10
10 changed files with 36 additions and 57 deletions
|
|
@ -272,8 +272,7 @@ defmodule Pleroma.Web.Websub do
|
|||
signature = sign(secret || "", xml)
|
||||
Logger.info(fn -> "Pushing #{topic} to #{callback}" end)
|
||||
|
||||
with {:reachable, true} <- {:reachable, Instances.reachable?(callback)},
|
||||
{:ok, %{status: code}} when code in 200..299 <-
|
||||
with {:ok, %{status: code}} when code in 200..299 <-
|
||||
@httpoison.post(
|
||||
callback,
|
||||
xml,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ defmodule Pleroma.Web.Websub.WebsubController do
|
|||
]
|
||||
)
|
||||
|
||||
plug(:set_requester_reachable when action in [:websub_incoming])
|
||||
plug(Pleroma.Web.Plugs.SetRequesterReachablePlug when action in [:websub_incoming])
|
||||
|
||||
def websub_subscription_request(conn, %{"nickname" => nickname} = params) do
|
||||
user = User.get_cached_by_nickname(nickname)
|
||||
|
|
@ -96,9 +96,4 @@ defmodule Pleroma.Web.Websub.WebsubController do
|
|||
|> send_resp(500, "Error")
|
||||
end
|
||||
end
|
||||
|
||||
defp set_requester_reachable(conn, _) do
|
||||
Pleroma.Web.ControllerHelper.set_requester_reachable(conn)
|
||||
conn
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue