Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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.14.0"

val akkaHttp = "com.typesafe.akka" %% "akka-http" % "10.2.10"
val akkaStreamVersion = "2.6.20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] {}
Expand All @@ -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

Expand Down
Loading