Merge branch '534_federation_targets_reachability' into 'develop'

[#534] Unreachable federation targets retirement

Closes #534

See merge request pleroma/pleroma!703
This commit is contained in:
href 2019-02-01 09:14:35 +00:00
commit b3b0855456
24 changed files with 759 additions and 99 deletions

View file

@ -696,6 +696,14 @@ defmodule HttpRequestMock do
{:ok, %Tesla.Env{status: 200, body: "hello"}}
end
def get("http://404.site" <> _, _, _, _) do
{:ok,
%Tesla.Env{
status: 404,
body: ""
}}
end
def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{
@ -716,6 +724,26 @@ defmodule HttpRequestMock do
}}
end
def post("http://200.site" <> _, _, _, _) do
{:ok,
%Tesla.Env{
status: 200,
body: ""
}}
end
def post("http://connrefused.site" <> _, _, _, _) do
{:error, :connrefused}
end
def post("http://404.site" <> _, _, _, _) do
{:ok,
%Tesla.Env{
status: 404,
body: ""
}}
end
def post(url, _query, _body, _headers) do
{:error, "Not implemented the mock response for post #{inspect(url)}"}
end