mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 19:29:11 +00:00
Don't enable Pleroma.HTTP.Middleware.FollowRedirects unless Gun is used
This commit is contained in:
parent
10d46235cf
commit
4bac25e6f5
1 changed files with 8 additions and 1 deletions
|
@ -69,7 +69,8 @@ defmodule Pleroma.HTTP do
|
|||
request = build_request(method, headers, options, url, body, params)
|
||||
|
||||
adapter = Application.get_env(:tesla, :adapter)
|
||||
client = Tesla.client([Pleroma.HTTP.Middleware.FollowRedirects], adapter)
|
||||
|
||||
client = Tesla.client(adapter_middlewares(adapter), adapter)
|
||||
|
||||
maybe_limit(
|
||||
fn ->
|
||||
|
@ -107,4 +108,10 @@ defmodule Pleroma.HTTP do
|
|||
defp maybe_limit(fun, _, _) do
|
||||
fun.()
|
||||
end
|
||||
|
||||
defp adapter_middlewares(Tesla.Adapter.Gun) do
|
||||
[Pleroma.HTTP.Middleware.FollowRedirects]
|
||||
end
|
||||
|
||||
defp adapter_middlewares(_), do: []
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue