diff --git a/build.sbt b/build.sbt index e93bb4d5bc..0b68d97948 100644 --- a/build.sbt +++ b/build.sbt @@ -154,7 +154,7 @@ val fs2_3_version = "3.14.0" val catsEffect_2_version = "2.5.5" -val fs2_2_version = "2.5.13" +val fs2_2_version = "3.16.0" val akkaHttp = "com.typesafe.akka" %% "akka-http" % "10.2.10" val akkaStreamVersion = "2.6.20" diff --git a/effects/fs2/src/main/scala/sttp/client4/impl/fs2/Fs2ServerSentEvents.scala b/effects/fs2/src/main/scala/sttp/client4/impl/fs2/Fs2ServerSentEvents.scala index 4de61997ad..79487d059a 100644 --- a/effects/fs2/src/main/scala/sttp/client4/impl/fs2/Fs2ServerSentEvents.scala +++ b/effects/fs2/src/main/scala/sttp/client4/impl/fs2/Fs2ServerSentEvents.scala @@ -2,11 +2,12 @@ package sttp.client4.impl.fs2 import fs2.text import sttp.model.sse.ServerSentEvent +import fs2.text.utf8 object Fs2ServerSentEvents { def parse[F[_]]: fs2.Pipe[F, Byte, ServerSentEvent] = { response => response - .through(text.utf8Decode[F]) + .through(utf8.decode[F]) .through(text.lines[F]) .split(_.isEmpty) .filter(_.nonEmpty) diff --git a/effects/fs2/src/test/scala/sttp/client4/impl/fs2/Fs2StreamingTest.scala b/effects/fs2/src/test/scala/sttp/client4/impl/fs2/Fs2StreamingTest.scala index e38b508de3..54028b539c 100644 --- a/effects/fs2/src/test/scala/sttp/client4/impl/fs2/Fs2StreamingTest.scala +++ b/effects/fs2/src/test/scala/sttp/client4/impl/fs2/Fs2StreamingTest.scala @@ -7,6 +7,7 @@ import sttp.capabilities.fs2.Fs2Streams import sttp.client4.impl.cats.CatsTestBase import sttp.model.sse.ServerSentEvent import sttp.client4.testing.streaming.StreamingTest +import fs2.text trait Fs2StreamingTest extends StreamingTest[IO, Fs2Streams[IO]] with CatsTestBase { override val streams: Fs2Streams[IO] = new Fs2Streams[IO] {} @@ -19,7 +20,7 @@ trait Fs2StreamingTest extends StreamingTest[IO, Fs2Streams[IO]] with CatsTestBa override def bodyConsumer(stream: fs2.Stream[IO, Byte]): IO[String] = stream - .through(fs2.text.utf8Decode) + .through(text.utf8.decode) .compile .foldMonoid