diff options
3 files changed, 8 insertions, 4 deletions
diff --git a/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala b/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala index 49446f2..f0262fc 100644 --- a/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala +++ b/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala @@ -173,10 +173,9 @@ class AkkaHttpSttpHandler private (actorSystem: ActorSystem, decoder.decodeMessage(response) } - def close(): Future[Unit] = { + override def close(): Unit = { implicit val ec = this.ec - if (terminateActorSystemOnClose) actorSystem.terminate().map(_ => ()) - else Future.successful(()) + if (terminateActorSystemOnClose) actorSystem.terminate() } private implicit class RichTry[T](t: Try[T]) { diff --git a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala index 1e924a0..ab35725 100644 --- a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala +++ b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala @@ -218,7 +218,7 @@ abstract class AsyncHttpClientHandler[R[_], S]( } } - def close(): Unit = { + override def close(): Unit = { if (closeClient) asyncHttpClient.close() } diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala index 00d9e6f..e5a73f7 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -262,6 +262,11 @@ class BasicTests .force() response.body should be("a==/b c:=/d") } + + name should "post without a body" in { + val response = postEcho.send().force() + response.body should be("POST /echo") + } } def headerTests(): Unit = { |