Merge branch 'finch-redirects' into 'develop'

Fix following redirects with Finch

See merge request pleroma/pleroma!4023
This commit is contained in:
feld 2023-12-29 17:00:58 +00:00
commit 8ac4458630
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Following HTTP Redirects when the HTTP Adapter is Finch

View File

@ -106,6 +106,10 @@ defmodule Pleroma.HTTP do
[Tesla.Middleware.FollowRedirects, Pleroma.Tesla.Middleware.ConnectionPool] [Tesla.Middleware.FollowRedirects, Pleroma.Tesla.Middleware.ConnectionPool]
end end
defp adapter_middlewares({Tesla.Adapter.Finch, _}) do
[Tesla.Middleware.FollowRedirects]
end
defp adapter_middlewares(_) do defp adapter_middlewares(_) do
if Pleroma.Config.get(:env) == :test do if Pleroma.Config.get(:env) == :test do
# Emulate redirects in test env, which are handled by adapters in other environments # Emulate redirects in test env, which are handled by adapters in other environments