diff --git a/instrumentation-security/http4s-ember-server-2.12_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala b/instrumentation-security/http4s-ember-server-2.12_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala index fd47e3026..08fee63a2 100644 --- a/instrumentation-security/http4s-ember-server-2.12_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala +++ b/instrumentation-security/http4s-ember-server-2.12_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala @@ -11,6 +11,7 @@ import com.newrelic.api.agent.security.schema.exceptions.NewRelicSecurityExcepti import com.newrelic.api.agent.security.schema.operation.RXSSOperation import com.newrelic.api.agent.security.schema.policy.AgentPolicy import com.newrelic.api.agent.security.utils.logging.LogLevel +import fs2.RaiseThrowable import fs2.text.decodeWithCharset import org.http4s.Charset.`UTF-8` import org.http4s.{Headers, Message, Request, Response} @@ -113,7 +114,7 @@ object RequestProcessor { private def extractBody[F[_]: Sync](msg: Message[F]): F[String] = { if (msg.contentType.nonEmpty && msg.contentType.get.charset.nonEmpty) { val charset = msg.contentType.get.charset.get; - msg.body.through(decodeWithCharset(charset.nioCharset)).compile.string + msg.bodyText(RaiseThrowable.fromApplicativeError, defaultCharset = charset).compile.string } else { msg.bodyText.compile.string } diff --git a/instrumentation-security/http4s-ember-server-2.13_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala b/instrumentation-security/http4s-ember-server-2.13_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala index 16babe40a..a20ba8989 100644 --- a/instrumentation-security/http4s-ember-server-2.13_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala +++ b/instrumentation-security/http4s-ember-server-2.13_0.23/src/main/scala/com.newrelic.agent.security.http4s.ember.server/RequestProcessor.scala @@ -11,6 +11,7 @@ import com.newrelic.api.agent.security.schema.exceptions.NewRelicSecurityExcepti import com.newrelic.api.agent.security.schema.operation.RXSSOperation import com.newrelic.api.agent.security.schema.policy.AgentPolicy import com.newrelic.api.agent.security.utils.logging.LogLevel +import fs2.RaiseThrowable import fs2.text.decodeWithCharset import org.http4s.{Headers, Message, Request, Response} @@ -85,7 +86,7 @@ object RequestProcessor { private def extractBody[F[_]: Sync](msg: Message[F]): F[String] = { if (msg.contentType.nonEmpty && msg.contentType.get.charset.nonEmpty) { val charset = msg.contentType.get.charset.get; - msg.body.through(decodeWithCharset(charset.nioCharset)).compile.string + msg.bodyText(RaiseThrowable.fromApplicativeError, defaultCharset = charset).compile.string } else { msg.bodyText.compile.string }