From 9b9165fdbc695d3e74e2c4f87195a37ad8ef8aba Mon Sep 17 00:00:00 2001 From: Benjamin Benoist Date: Tue, 26 Nov 2024 16:02:48 +0100 Subject: [PATCH] Upgrade collector to 3.2.1 --- project/Dependencies.scala | 2 +- .../MicroHttpServer.scala | 17 ++--------------- .../Run.scala | 1 - 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index e63f8d9..bbeb306 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -16,7 +16,7 @@ object Dependencies { object V { // Snowplow - val snowplowStreamCollector = "3.2.0" + val snowplowStreamCollector = "3.2.1" val snowplowCommonEnrich = "5.1.4" val http4sCirce = "0.23.23" diff --git a/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala b/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala index 39a1687..dca6ac5 100644 --- a/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala +++ b/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala @@ -19,9 +19,8 @@ import com.snowplowanalytics.snowplow.micro.Configuration.{MicroConfig, SinkConf import org.http4s.blaze.server.BlazeServerBuilder import org.http4s.headers.`Strict-Transport-Security` import org.http4s.server.Server -import org.http4s.server.middleware.{HSTS, Metrics, Timeout, Logger => LoggerMiddleware} +import org.http4s.server.middleware.{HSTS, Metrics, Timeout} import org.http4s.{HttpApp, HttpRoutes} -import org.typelevel.ci.CIString import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger @@ -57,9 +56,7 @@ object MicroHttpServer { private def builder(routes: HttpRoutes[IO], config: CollectorConfig[SinkConfig]): BlazeServerBuilder[IO] = { BlazeServerBuilder[IO] - .withHttpApp( - loggerMiddleware(timeoutMiddleware(hstsMiddleware(config.hsts, routes.orNotFound), config.networking), config.debug.http) - ) + .withHttpApp(timeoutMiddleware(hstsMiddleware(config.hsts, routes.orNotFound), config.networking)) .withIdleTimeout(config.networking.idleTimeout) .withMaxConnections(config.networking.maxConnections) .withResponseHeaderTimeout(config.networking.responseHeaderTimeout) @@ -69,16 +66,6 @@ object MicroHttpServer { ) } - private def loggerMiddleware(routes: HttpApp[IO], config: CollectorConfig.Debug.Http): HttpApp[IO] = - if (config.enable) { - LoggerMiddleware.httpApp[IO]( - logHeaders = config.logHeaders, - logBody = config.logBody, - redactHeadersWhen = config.redactHeaders.map(CIString(_)).contains(_), - logAction = Some((msg: String) => Logger[IO].debug(msg)) - )(routes) - } else routes - private def timeoutMiddleware(routes: HttpApp[IO], networking: CollectorConfig.Networking): HttpApp[IO] = Timeout.httpApp[IO](timeout = networking.responseHeaderTimeout)(routes) diff --git a/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala b/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala index bd46f88..6204a70 100644 --- a/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala +++ b/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala @@ -66,7 +66,6 @@ object Run { config.collector.enableDefaultRedirect, config.collector.rootResponse.enabled, config.collector.crossDomain.enabled, - config.collector.networking.bodyReadTimeout, collectorService ).value