diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-09-08 11:26:12 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-09-08 11:26:12 +0000 |
commit | a08196ca680554315e088e9ea4191f292bbe2642 (patch) | |
tree | e38dad4a9fd0d566859755aec6c40f4f3a62fd2d /lib/pleroma/web/rel_me.ex | |
parent | 6a567a131ec04dbeb71012f2caeebf563ed453a4 (diff) | |
parent | d34dc4a7469b97e28ca4fffc8b2387c937ab56d8 (diff) | |
download | pleroma-fix/disable-favicons-in-tests.tar.gz |
Merge branch 'develop' into 'fix/disable-favicons-in-tests'fix/disable-favicons-in-tests
# Conflicts:
# config/test.exs
Diffstat (limited to 'lib/pleroma/web/rel_me.ex')
-rw-r--r-- | lib/pleroma/web/rel_me.ex | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/pleroma/web/rel_me.ex b/lib/pleroma/web/rel_me.ex index 8e2b51508..28f75b18d 100644 --- a/lib/pleroma/web/rel_me.ex +++ b/lib/pleroma/web/rel_me.ex @@ -5,7 +5,8 @@ defmodule Pleroma.Web.RelMe do @options [ pool: :media, - max_body: 2_000_000 + max_body: 2_000_000, + recv_timeout: 2_000 ] if Pleroma.Config.get(:env) == :test do @@ -23,18 +24,8 @@ defmodule Pleroma.Web.RelMe do def parse(_), do: {:error, "No URL provided"} defp parse_url(url) do - opts = - if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do - Keyword.merge(@options, - recv_timeout: 2_000, - with_body: true - ) - else - @options - end - with {:ok, %Tesla.Env{body: html, status: status}} when status in 200..299 <- - Pleroma.HTTP.get(url, [], adapter: opts), + Pleroma.HTTP.get(url, [], @options), {:ok, html_tree} <- Floki.parse_document(html), data <- Floki.attribute(html_tree, "link[rel~=me]", "href") ++ |