mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Adopt deprecated APIs from fs2; use fs2.Path
This commit is contained in:
@ -309,7 +309,7 @@ trait Conversions {
|
||||
): F[UploadData[F]] = {
|
||||
def parseMeta(body: Stream[F, Byte]): F[ItemUploadMeta] =
|
||||
body
|
||||
.through(fs2.text.utf8Decode)
|
||||
.through(fs2.text.utf8.decode)
|
||||
.parseJsonAs[ItemUploadMeta]
|
||||
.map(
|
||||
_.fold(
|
||||
|
@ -9,7 +9,7 @@ package docspell.restserver.http4s
|
||||
import cats.data.NonEmptyList
|
||||
import cats.data.OptionT
|
||||
import cats.effect.Sync
|
||||
import fs2.text.utf8Encode
|
||||
import fs2.text.utf8
|
||||
import fs2.{Pure, Stream}
|
||||
|
||||
import org.http4s._
|
||||
@ -20,14 +20,14 @@ object Responses {
|
||||
private[this] val pureForbidden: Response[Pure] =
|
||||
Response(
|
||||
Status.Forbidden,
|
||||
body = Stream("Forbidden").through(utf8Encode),
|
||||
body = Stream("Forbidden").through(utf8.encode),
|
||||
headers = Headers(`Content-Type`(MediaType.text.plain, Charset.`UTF-8`) :: Nil)
|
||||
)
|
||||
|
||||
private[this] val pureUnauthorized: Response[Pure] =
|
||||
Response(
|
||||
Status.Unauthorized,
|
||||
body = Stream("Unauthorized").through(utf8Encode),
|
||||
body = Stream("Unauthorized").through(utf8.encode),
|
||||
headers = Headers(`Content-Type`(MediaType.text.plain, Charset.`UTF-8`) :: Nil)
|
||||
)
|
||||
|
||||
|
@ -92,7 +92,7 @@ object TemplateRoutes {
|
||||
Stream
|
||||
.bracket(Sync[F].delay(url.openStream))(in => Sync[F].delay(in.close()))
|
||||
.flatMap(in => fs2.io.readInputStream(in.pure[F], 64 * 1024, false))
|
||||
.through(text.utf8Decode)
|
||||
.through(text.utf8.decode)
|
||||
.compile
|
||||
.fold("")(_ + _)
|
||||
|
||||
|
Reference in New Issue
Block a user