Merge branch 'bind-to-localhost' into 'develop'
[akkoma] / lib / pleroma / web / ostatus / ostatus.ex
index 61515b31eb80ff7d6262e445ae14a72e07e25a29..6ed089d8458f6e51aacf0ca3da25462559340faf 100644 (file)
@@ -3,13 +3,12 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.OStatus do
-  @httpoison Application.get_env(:pleroma, :httpoison)
-
   import Ecto.Query
   import Pleroma.Web.XML
   require Logger
 
   alias Pleroma.Activity
+  alias Pleroma.HTTP
   alias Pleroma.Object
   alias Pleroma.Repo
   alias Pleroma.User
@@ -363,7 +362,7 @@ defmodule Pleroma.Web.OStatus do
   def fetch_activity_from_atom_url(url) do
     with true <- String.starts_with?(url, "http"),
          {:ok, %{body: body, status: code}} when code in 200..299 <-
-           @httpoison.get(
+           HTTP.get(
              url,
              [{:Accept, "application/atom+xml"}]
            ) do
@@ -380,7 +379,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, []),
+         {:ok, %{body: body}} <- HTTP.get(url, []),
          {:ok, atom_url} <- get_atom_url(body) do
       fetch_activity_from_atom_url(atom_url)
     else