diff --git a/pekko-http-ninny/src/main/scala/com/github/pjfanning/pekkohttpninny/NinnySupport.scala b/pekko-http-ninny/src/main/scala/com/github/pjfanning/pekkohttpninny/NinnySupport.scala index 6460974..00ae1fb 100644 --- a/pekko-http-ninny/src/main/scala/com/github/pjfanning/pekkohttpninny/NinnySupport.scala +++ b/pekko-http-ninny/src/main/scala/com/github/pjfanning/pekkohttpninny/NinnySupport.scala @@ -90,9 +90,7 @@ trait NinnySupport { * unmarshaller for any `A` value */ implicit def fromByteStringUnmarshaller[A: FromJson]: Unmarshaller[ByteString, A] = - Unmarshaller(_ => - bs => Future.fromTry(Json.parse(new String(bs.toArrayUnsafe(), StandardCharsets.UTF_8)).to[A]) - ) + Unmarshaller(_ => bs => Future.fromTry(Json.parse(bs.utf8String).to[A])) /** * HTTP entity => `Source[A, _]`