From 2950397d476b0fd015b28182572927539b88e8fb Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 29 Dec 2023 00:50:50 -0500 Subject: [PATCH] Fix following redirects with Finch --- changelog.d/finch_redirects.fix | 1 + lib/pleroma/http.ex | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 changelog.d/finch_redirects.fix diff --git a/changelog.d/finch_redirects.fix b/changelog.d/finch_redirects.fix new file mode 100644 index 000000000..c25beaba4 --- /dev/null +++ b/changelog.d/finch_redirects.fix @@ -0,0 +1 @@ +Following HTTP Redirects when the HTTP Adapter is Finch diff --git a/lib/pleroma/http.ex b/lib/pleroma/http.ex index d41061538..eec61cf14 100644 --- a/lib/pleroma/http.ex +++ b/lib/pleroma/http.ex @@ -106,6 +106,10 @@ defmodule Pleroma.HTTP do [Tesla.Middleware.FollowRedirects, Pleroma.Tesla.Middleware.ConnectionPool] end + defp adapter_middlewares({Tesla.Adapter.Finch, _}) do + [Tesla.Middleware.FollowRedirects] + end + defp adapter_middlewares(_) do if Pleroma.Config.get(:env) == :test do # Emulate redirects in test env, which are handled by adapters in other environments