remove follow_redirect options
authorHakaba Hitoyo <hakabahitoyo@example.com>
Thu, 6 Dec 2018 02:38:33 +0000 (11:38 +0900)
committerHakaba Hitoyo <hakabahitoyo@example.com>
Thu, 6 Dec 2018 02:38:33 +0000 (11:38 +0900)
lib/pleroma/http/connection.ex
lib/pleroma/reverse_proxy.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/ostatus/ostatus.ex
lib/pleroma/web/web_finger/web_finger.ex

index 66e0d056892ccc55dbb8d5a2b249b38f60dd552b..db46f9e5540f6bd9e9e3c66d35ef0e292d95c18e 100644 (file)
@@ -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)
 
index ad9dc82fe02a653bd9fd3a1272b509b4a5b430d2..4ca84152aa6abd786cb28d13d14a14fec8a15fc1 100644 (file)
@@ -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",
index 03a607f839c64f4996dd10f93877108160235fe5..922ffb94600f2c3e4aa5d004b00f8e9c014be98a 100644 (file)
@@ -765,8 +765,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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
index 300bdc04ae72329cbd5bfdfee73a628ba68f4259..fc4f3fdc76e00adcd3cf197c95ce214f190d76a1 100644 (file)
@@ -1185,7 +1185,6 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
              @httpoison.get(
                url,
                [],
-               follow_redirect: true,
                adapter: [
                  timeout: timeout,
                  recv_timeout: timeout
index bc14b8785ad0a1de62fd2598f941ab2ce4447a8a..9f33cd5cd402ea163b6c34c4eee03f1b01d8b931 100644 (file)
@@ -349,8 +349,7 @@ defmodule Pleroma.Web.OStatus 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 @@ defmodule Pleroma.Web.OStatus 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
index 99c65a6bfd14dfeb51d3fba6e8a31496c9750c66..0ff3b8b5f7a6cb243eccf58596c78fc5d0c69f86 100644 (file)
@@ -221,7 +221,7 @@ defmodule Pleroma.Web.WebFinger 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
       _ ->