forked from AkkomaGang/akkoma
FollowRedirects: Unconditionally release the connection if there is an error
There is no need for streaming the body if there is no body
This commit is contained in:
parent
9df5918974
commit
12fa5541f0
1 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,10 @@ defp redirect(env, next, left) do
|
||||||
release_conn(opts)
|
release_conn(opts)
|
||||||
{:error, {__MODULE__, :too_many_redirects}}
|
{:error, {__MODULE__, :too_many_redirects}}
|
||||||
|
|
||||||
|
{:error, _} = e ->
|
||||||
|
release_conn(opts)
|
||||||
|
e
|
||||||
|
|
||||||
other ->
|
other ->
|
||||||
unless opts[:body_as] == :chunks do
|
unless opts[:body_as] == :chunks do
|
||||||
release_conn(opts)
|
release_conn(opts)
|
||||||
|
|
Loading…
Reference in a new issue