diff options
author | n4to4 <n4to4k@gmail.com> | 2018-04-24 18:19:50 +0900 |
---|---|---|
committer | n4to4 <n4to4k@gmail.com> | 2018-04-24 18:23:21 +0900 |
commit | 4e0ab8d83a92a07b40d85ff9ce5a6c9278b88b88 (patch) | |
tree | 980088d603d85e491bc1543894ed0fec8ff171f4 /tests/src/test/scala/com | |
parent | 9406043b822a3aa9a7ef27630036a91cc3e7ed3a (diff) | |
download | sttp-4e0ab8d83a92a07b40d85ff9ce5a6c9278b88b88.tar.gz sttp-4e0ab8d83a92a07b40d85ff9ce5a6c9278b88b88.tar.bz2 sttp-4e0ab8d83a92a07b40d85ff9ce5a6c9278b88b88.zip |
Set `followRedirects` explicitly, and disable redirects if `maxRedirects <= 0`
Diffstat (limited to 'tests/src/test/scala/com')
-rw-r--r-- | tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala index 4138fe2..392f6d8 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -638,6 +638,13 @@ class BasicTests resp.code should be(0) resp.history should have size (maxRedirects) } + + name should "not redirect when maxRedirects is less than or equal to 0" in { + val resp = loop.maxRedirects(-1).send().force() + resp.code should be(302) + resp.body should be('left) + resp.history should be('empty) + } } def timeoutTests(): Unit = { |