mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-03 13:58:41 +00:00
Merge branch 'finch-redirects' into 'develop'
Fix following redirects with Finch See merge request pleroma/pleroma!4023
This commit is contained in:
commit
8ac4458630
2 changed files with 5 additions and 0 deletions
1
changelog.d/finch_redirects.fix
Normal file
1
changelog.d/finch_redirects.fix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Following HTTP Redirects when the HTTP Adapter is Finch
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue