FollowRedirects: Unconditionally release the connection if there is an error

There is no need for streaming the body if there is no body
stable
rinpatch 4 years ago
parent 9df5918974
commit 12fa5541f0

@ -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)

Loading…
Cancel
Save