diff options
Diffstat (limited to 'core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala')
-rw-r--r-- | core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala b/core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala index 96c0213..7004631 100644 --- a/core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala +++ b/core/src/main/scala/com/softwaremill/sttp/FollowRedirectsBackend.scala @@ -29,7 +29,7 @@ class FollowRedirectsBackend[R[_], S](delegate: SttpBackend[R, S]) extends SttpB private def followRedirect[T](request: Request[T, S], response: Response[T], redirects: Int): R[Response[T]] = { response.header(LocationHeader).fold(responseMonad.unit(response)) { loc => - if (redirects >= FollowRedirectsBackend.MaxRedirects) { + if (redirects >= request.options.maxRedirects) { responseMonad.unit(Response(Left("Too many redirects"), 0, "", Nil, Nil)) } else { followRedirect(request, response, redirects, loc) |