logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 2950397d476b0fd015b28182572927539b88e8fb
parent 3954dfd4f1881845a60f117a86ef96f3997c6c3c
Author: Mark Felder <feld@feld.me>
Date:   Fri, 29 Dec 2023 00:50:50 -0500

Fix following redirects with Finch

Diffstat:

Achangelog.d/finch_redirects.fix1+
Mlib/pleroma/http.ex4++++
2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/changelog.d/finch_redirects.fix 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 @@ -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