diff --git a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/DidCommHttpServer.scala b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/DidCommHttpServer.scala index 7dfda91d28..8cf7a05c83 100644 --- a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/DidCommHttpServer.scala +++ b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/DidCommHttpServer.scala @@ -29,8 +29,8 @@ object DidCommHttpServer { def run(didCommServicePort: Int) = { val server = { - val config = ServerConfig(address = new java.net.InetSocketAddress(didCommServicePort)) - ServerConfig.live(config)(using Trace.empty) >>> Server.live + val config = Server.Config.default.copy(address = new java.net.InetSocketAddress(didCommServicePort)) + ZLayer.succeed(config) >>> Server.live } for { _ <- ZIO.logInfo(s"Server Started on port $didCommServicePort") @@ -46,12 +46,8 @@ object DidCommHttpServer { DIDResolver & DIDNonSecretStorage & AppConfig, Nothing ] = Http.collectZIO[Request] { - case req @ Method.POST -> !! - if req.headersAsList - .exists(h => - h.key.toString.equalsIgnoreCase("content-type") && - h.value.toString.equalsIgnoreCase(MediaTypes.contentTypeEncrypted) - ) => + case req @ Method.POST -> Root + if req.rawHeader("content-type").fold(false) { _.equalsIgnoreCase(MediaTypes.contentTypeEncrypted) } => val result = for { data <- req.body.asString.mapError(e => RequestBodyParsingError(e.getMessage)) _ <- webServerProgram(data)