From 45ea3546ef6cc2416d667ba94d5039b72e1478a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 11:20:12 +0200 Subject: [PATCH 1/6] Netty backend --- nio-server/build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/nio-server/build.sbt b/nio-server/build.sbt index 1ccb226..7af7f36 100644 --- a/nio-server/build.sbt +++ b/nio-server/build.sbt @@ -6,6 +6,7 @@ organization := "fr.maif" lazy val `nio-server` = (project in file(".")) .enablePlugins(PlayScala, DockerPlugin) + .disablePlugins(PlayPekkoHttpServer) .enablePlugins(NoPublish) .disablePlugins(BintrayPlugin) From 35d26184e0d877666bbbf2ae1b5a3de1217ac2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 11:29:33 +0200 Subject: [PATCH 2/6] Netty backend --- nio-server/conf/application.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nio-server/conf/application.conf b/nio-server/conf/application.conf index dd36311..06e1edc 100644 --- a/nio-server/conf/application.conf +++ b/nio-server/conf/application.conf @@ -6,6 +6,8 @@ play.application.loader = loader.NioLoader // add filter NioFilter play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule" +play.server.provider = "play.core.server.NettyServerProvider" + play { filters { enabled += filters.OtoroshiFilter From c87384c8445910f68a5304b77797e401cc9d4ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 11:41:56 +0200 Subject: [PATCH 3/6] Netty backend --- nio-server/build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/nio-server/build.sbt b/nio-server/build.sbt index 7af7f36..cc1f71a 100644 --- a/nio-server/build.sbt +++ b/nio-server/build.sbt @@ -26,6 +26,7 @@ ThisBuild / scalafixDependencies ++= Seq("org.reactivemongo" %% "reactivemongo- libraryDependencies ++= Seq( ws, + nettyServer, "org.apache.pekko" %% "pekko-stream" % pekko, "org.apache.pekko" %% "pekko-actor-typed" % pekko, "org.apache.pekko" %% "pekko-slf4j" % pekko, From a9f85198358e13a717778fa68e360b4e9c3bd1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 13:21:58 +0200 Subject: [PATCH 4/6] Netty backend --- nio-server/build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/nio-server/build.sbt b/nio-server/build.sbt index cc1f71a..4ffe18b 100644 --- a/nio-server/build.sbt +++ b/nio-server/build.sbt @@ -82,6 +82,7 @@ assembly / assemblyMergeStrategy := { case PathList(xs @ _*) if xs.lastOption.contains("mime.types") => MergeStrategy.first case PathList(ps @ _*) if ps.last == "io.netty.versions.properties" => MergeStrategy.first case PathList(ps @ _*) if ps.contains("reference-overrides.conf") => MergeStrategy.concat + case PathList(ps @ _*) if ps.contains("reflect-config.json") => MergeStrategy.first case PathList(ps @ _*) if ps.contains("native-image.properties") => MergeStrategy.first case PathList(ps @ _*) if ps.last endsWith ".conf" => MergeStrategy.concat case PathList(ps @ _*) if ps.contains("buildinfo") => MergeStrategy.discard From 6ea217db80a104409c4ad01fe4a3c7a6dff3ee93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 13:24:46 +0200 Subject: [PATCH 5/6] Netty backend --- nio-server/build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nio-server/build.sbt b/nio-server/build.sbt index 4ffe18b..6acd2d5 100644 --- a/nio-server/build.sbt +++ b/nio-server/build.sbt @@ -12,6 +12,8 @@ lazy val `nio-server` = (project in file(".")) scalaVersion := Dependencies._scalaVersion +PlayKeys.devSettings += "play.server.provider" -> "play.core.server.NettyServerProvider" + resolvers ++= Seq( Resolver.jcenterRepo, "Maven central" at "https://repo1.maven.org/maven2/" @@ -42,7 +44,6 @@ libraryDependencies ++= Seq( "org.apache.commons" % "commons-lang3" % "3.11", "de.svenkubiak" % "jBCrypt" % "0.4.1", // ISC/BSD "com.auth0" % "java-jwt" % javaJwt, // MIT license -// "com.github.pureconfig" %% "pureconfig" % pureConfig, // Apache 2.0 "com.github.pureconfig" %% "pureconfig-core" % pureConfig, // Apache 2.0 "com.github.pureconfig" %% "pureconfig-generic-scala3" % pureConfig, // Apache 2.0 "org.scalactic" %% "scalactic" % scalaticVersion, // Apache 2.0 From f9dda69544042f0cf681ecb3ea844fb6bf8b9be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Del=C3=A8gue?= Date: Tue, 22 Oct 2024 13:33:33 +0200 Subject: [PATCH 6/6] Netty backend --- nio-server/conf/application.conf | 2 +- nio-server/test/controllers/HomeControllerSpec.scala | 2 +- nio-server/test/controllers/TenantControllerSpec.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nio-server/conf/application.conf b/nio-server/conf/application.conf index 06e1edc..ef6a7b7 100644 --- a/nio-server/conf/application.conf +++ b/nio-server/conf/application.conf @@ -6,7 +6,7 @@ play.application.loader = loader.NioLoader // add filter NioFilter play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule" -play.server.provider = "play.core.server.NettyServerProvider" +play.server.provider = play.core.server.NettyServerProvider play { filters { diff --git a/nio-server/test/controllers/HomeControllerSpec.scala b/nio-server/test/controllers/HomeControllerSpec.scala index c915668..e9f84a6 100644 --- a/nio-server/test/controllers/HomeControllerSpec.scala +++ b/nio-server/test/controllers/HomeControllerSpec.scala @@ -20,7 +20,7 @@ class HomeControllerSpec extends TestUtils { callJson(s"/$tenant/bo", GET, api = false) response.status must be(OK) - response.contentType must be("text/html; charset=UTF-8") + response.contentType.toLowerCase must be("text/html; charset=utf-8") } } diff --git a/nio-server/test/controllers/TenantControllerSpec.scala b/nio-server/test/controllers/TenantControllerSpec.scala index 826e601..e809f17 100644 --- a/nio-server/test/controllers/TenantControllerSpec.scala +++ b/nio-server/test/controllers/TenantControllerSpec.scala @@ -100,7 +100,7 @@ class TenantControllerSpec extends TestUtils { postXml(path, tenantXml, headers = Seq(CONTENT_TYPE -> XML, secret)) resp.status mustBe CREATED - resp.contentType mustBe s"$XML; charset=UTF-8" + resp.contentType.toLowerCase mustBe s"$XML; charset=utf-8" } "create with content-type json" in {