Browse Source

FollowRedirects: Unconditionally release the connection if there is an error

There is no need for streaming the body if there is no body
chores/our-libs-hex-releases
rinpatch 4 years ago
parent
commit
12fa5541f0
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      lib/pleroma/tesla/middleware/follow_redirects.ex

+ 4
- 0
lib/pleroma/tesla/middleware/follow_redirects.ex View File

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