aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/tesla/middleware/follow_redirects.ex4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/tesla/middleware/follow_redirects.ex b/lib/pleroma/tesla/middleware/follow_redirects.ex
index f2c502c69..5a7032215 100644
--- a/lib/pleroma/tesla/middleware/follow_redirects.ex
+++ b/lib/pleroma/tesla/middleware/follow_redirects.ex
@@ -55,6 +55,10 @@ defmodule Pleroma.HTTP.Middleware.FollowRedirects do
release_conn(opts)
{:error, {__MODULE__, :too_many_redirects}}
+ {:error, _} = e ->
+ release_conn(opts)
+ e
+
other ->
unless opts[:body_as] == :chunks do
release_conn(opts)