From a418547bdfc95b72497faa0eb5da69b04f6a8566 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Wed, 5 Dec 2018 16:08:34 +0900 Subject: [PATCH] debug /api/v1/suggestions --- .../web/mastodon_api/mastodon_api_controller.ex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index ea64f163d..f9007a808 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -1169,7 +1169,15 @@ def suggestions(%{assigns: %{user: user}} = conn, _) do url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user) with {:ok, %{status: 200, body: body}} <- - @httpoison.get(url, [], timeout: timeout, recv_timeout: timeout), + @httpoison.get( + url, + [], + follow_redirect: true, + adapter: [ + timeout: timeout, + recv_timeout: timeout + ] + ), {:ok, data} <- Jason.decode(body) do data2 = Enum.slice(data, 0, limit)