Fix following redirects with Finch

This commit is contained in:
Mark Felder 2023-12-29 00:50:50 -05:00
parent 3954dfd4f1
commit 2950397d47
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 @@ defp adapter_middlewares(Tesla.Adapter.Gun) 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