Skip to content

Commit

Permalink
Make everything compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Shota Jolbordi committed Sep 26, 2023
1 parent 2235774 commit b25ed88
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit b25ed88

Please sign in to comment.