diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-01-24 11:54:52 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-01-24 11:54:52 +0300 |
commit | 20b54366ee916677b3865acf36baeeb062dd550b (patch) | |
tree | adad4a06c7ef19bc010dd199e043dca671621442 /lib | |
parent | f161a92cb1abd981e37367fcd5d315ac14510d12 (diff) | |
download | pleroma-20b54366ee916677b3865acf36baeeb062dd550b.tar.gz |
[#534] Federation publish requests status control (enforced 2xx response code check).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/salmon/salmon.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/websub/websub.ex | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index b14c91c18..10155ff5a 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -742,7 +742,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do digest: digest }) - with {:ok, _} <- + with {:ok, %{status: code}} when code in 200..299 <- result = @httpoison.post( inbox, diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex index 0a0b91433..0423ccee0 100644 --- a/lib/pleroma/web/salmon/salmon.ex +++ b/lib/pleroma/web/salmon/salmon.ex @@ -169,7 +169,7 @@ defmodule Pleroma.Web.Salmon do defp send_to_user(url, feed, poster) when is_binary(url) do with {:reachable, true} <- {:reachable, Instances.reachable?(url)}, - {:ok, %{status: code}} <- + {:ok, %{status: code}} when code in 200..299 <- poster.( url, feed, diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index a6bbaef37..9ceb5fbf7 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -269,7 +269,7 @@ defmodule Pleroma.Web.Websub do Logger.info(fn -> "Pushing #{topic} to #{callback}" end) with {:reachable, true} <- {:reachable, Instances.reachable?(callback)}, - {:ok, %{status: code}} <- + {:ok, %{status: code}} when code in 200..299 <- @httpoison.post( callback, xml, |