mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 00:09:35 +00:00
[#534] Federation publish requests status control (enforced 2xx response code check).
This commit is contained in:
parent
f161a92cb1
commit
20b54366ee
|
@ -742,7 +742,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
digest: digest
|
digest: digest
|
||||||
})
|
})
|
||||||
|
|
||||||
with {:ok, _} <-
|
with {:ok, %{status: code}} when code in 200..299 <-
|
||||||
result =
|
result =
|
||||||
@httpoison.post(
|
@httpoison.post(
|
||||||
inbox,
|
inbox,
|
||||||
|
|
|
@ -169,7 +169,7 @@ defmodule Pleroma.Web.Salmon do
|
||||||
|
|
||||||
defp send_to_user(url, feed, poster) when is_binary(url) do
|
defp send_to_user(url, feed, poster) when is_binary(url) do
|
||||||
with {:reachable, true} <- {:reachable, Instances.reachable?(url)},
|
with {:reachable, true} <- {:reachable, Instances.reachable?(url)},
|
||||||
{:ok, %{status: code}} <-
|
{:ok, %{status: code}} when code in 200..299 <-
|
||||||
poster.(
|
poster.(
|
||||||
url,
|
url,
|
||||||
feed,
|
feed,
|
||||||
|
|
|
@ -269,7 +269,7 @@ defmodule Pleroma.Web.Websub do
|
||||||
Logger.info(fn -> "Pushing #{topic} to #{callback}" end)
|
Logger.info(fn -> "Pushing #{topic} to #{callback}" end)
|
||||||
|
|
||||||
with {:reachable, true} <- {:reachable, Instances.reachable?(callback)},
|
with {:reachable, true} <- {:reachable, Instances.reachable?(callback)},
|
||||||
{:ok, %{status: code}} <-
|
{:ok, %{status: code}} when code in 200..299 <-
|
||||||
@httpoison.post(
|
@httpoison.post(
|
||||||
callback,
|
callback,
|
||||||
xml,
|
xml,
|
||||||
|
|
Loading…
Reference in a new issue