aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-06-30 15:58:53 +0300
committerrinpatch <rinpatch@sdf.org>2020-07-15 15:26:35 +0300
commit12fa5541f01ca5cfe082a62dac3317da78043e8f (patch)
tree3b436a68ab4dfce90e552e63bf127691307a64b7
parent9df59189747620c60173e6a67f8721971f123efd (diff)
downloadpleroma-12fa5541f01ca5cfe082a62dac3317da78043e8f.tar.gz
FollowRedirects: Unconditionally release the connection if there is an error
There is no need for streaming the body if there is no body
-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)