projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix Cron.PurgeExpiredActivitiesWorker
[akkoma]
/
lib
/
pleroma
/
http
/
http.ex
diff --git
a/lib/pleroma/http/http.ex
b/lib/pleroma/http/http.ex
index 6128bc4cf94d5ac863a72d9dbe5922b9259eba29..b37b3fa8927c252a9b357e51d5635ca20f5d2376 100644
(file)
--- a/
lib/pleroma/http/http.ex
+++ b/
lib/pleroma/http/http.ex
@@
-69,7
+69,8
@@
defmodule Pleroma.HTTP do
request = build_request(method, headers, options, url, body, params)
adapter = Application.get_env(:tesla, :adapter)
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 ->
maybe_limit(
fn ->
@@
-107,4
+108,10
@@
defmodule Pleroma.HTTP do
defp maybe_limit(fun, _, _) do
fun.()
end
defp maybe_limit(fun, _, _) do
fun.()
end
+
+ defp adapter_middlewares(Tesla.Adapter.Gun) do
+ [Pleroma.HTTP.Middleware.FollowRedirects]
+ end
+
+ defp adapter_middlewares(_), do: []
end
end