remove follow_redirect options
This commit is contained in:
parent
27792b2d77
commit
96ba95df2e
|
@ -6,7 +6,8 @@ defmodule Pleroma.HTTP.Connection do
|
|||
@hackney_options [
|
||||
pool: :default,
|
||||
timeout: 10000,
|
||||
recv_timeout: 20000
|
||||
recv_timeout: 20000,
|
||||
follow_redirect: true
|
||||
]
|
||||
@adapter Application.get_env(:tesla, :adapter)
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ defmodule Pleroma.ReverseProxy do
|
|||
@hackney Application.get_env(:pleroma, :hackney, :hackney)
|
||||
@httpoison Application.get_env(:pleroma, :httpoison, HTTPoison)
|
||||
|
||||
@default_hackney_options [{:follow_redirect, true}]
|
||||
@default_hackney_options []
|
||||
|
||||
@inline_content_types [
|
||||
"image/gif",
|
||||
|
|
|
@ -765,8 +765,7 @@ def fetch_and_contain_remote_object_from_id(id) do
|
|||
{:ok, %{body: body, status: code}} when code in 200..299 <-
|
||||
@httpoison.get(
|
||||
id,
|
||||
[Accept: "application/activity+json"],
|
||||
follow_redirect: true
|
||||
Accept: "application/activity+json"
|
||||
),
|
||||
{:ok, data} <- Jason.decode(body),
|
||||
:ok <- Transmogrifier.contain_origin_from_id(id, data) do
|
||||
|
|
|
@ -1185,7 +1185,6 @@ def suggestions(%{assigns: %{user: user}} = conn, _) do
|
|||
@httpoison.get(
|
||||
url,
|
||||
[],
|
||||
follow_redirect: true,
|
||||
adapter: [
|
||||
timeout: timeout,
|
||||
recv_timeout: timeout
|
||||
|
|
|
@ -349,8 +349,7 @@ def fetch_activity_from_atom_url(url) do
|
|||
{:ok, %{body: body, status: code}} when code in 200..299 <-
|
||||
@httpoison.get(
|
||||
url,
|
||||
[Accept: "application/atom+xml"],
|
||||
follow_redirect: true
|
||||
Accept: "application/atom+xml"
|
||||
) do
|
||||
Logger.debug("Got document from #{url}, handling...")
|
||||
handle_incoming(body)
|
||||
|
@ -365,7 +364,7 @@ def fetch_activity_from_html_url(url) do
|
|||
Logger.debug("Trying to fetch #{url}")
|
||||
|
||||
with true <- String.starts_with?(url, "http"),
|
||||
{:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true),
|
||||
{:ok, %{body: body}} <- @httpoison.get(url, []),
|
||||
{:ok, atom_url} <- get_atom_url(body) do
|
||||
fetch_activity_from_atom_url(atom_url)
|
||||
else
|
||||
|
|
|
@ -221,7 +221,7 @@ def get_template_from_xml(body) do
|
|||
|
||||
def find_lrdd_template(domain) do
|
||||
with {:ok, %{status: status, body: body}} when status in 200..299 <-
|
||||
@httpoison.get("http://#{domain}/.well-known/host-meta", [], follow_redirect: true) do
|
||||
@httpoison.get("http://#{domain}/.well-known/host-meta", []) do
|
||||
get_template_from_xml(body)
|
||||
else
|
||||
_ ->
|
||||
|
|
Loading…
Reference in a new issue