Merge branch 'correct-and-improve-http-options' into 'develop'

Correct and improve http options

See merge request pleroma/pleroma!505
This commit is contained in:
kaniini 2018-12-06 15:57:56 +00:00
commit abead01ab6
8 changed files with 20 additions and 27 deletions

View file

@ -1216,7 +1216,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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,
[],
adapter: [
timeout: timeout,
recv_timeout: timeout
]
),
{:ok, data} <- Jason.decode(body) do
data2 =
Enum.slice(data, 0, limit)