diff --git a/http4s/src/main/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorService.scala b/http4s/src/main/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorService.scala index bfde83638..407b1856f 100644 --- a/http4s/src/main/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorService.scala +++ b/http4s/src/main/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorService.scala @@ -116,7 +116,7 @@ class CollectorService[F[_]: Sync]( config.paths.getOrElse(original, original) } - override def preflightResponse(req: Request[F]): F[Response[F]] = Sync[F].delay { + override def preflightResponse(req: Request[F]): F[Response[F]] = Sync[F].pure { Response[F]( headers = Headers( accessControlAllowOriginHeader(req), diff --git a/http4s/src/test/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorRoutesSpec.scala b/http4s/src/test/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorRoutesSpec.scala index 26a4ddea7..94682e3e8 100644 --- a/http4s/src/test/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorRoutesSpec.scala +++ b/http4s/src/test/scala/com.snowplowanalytics.snowplow.collectors.scalastream/CollectorRoutesSpec.scala @@ -29,7 +29,7 @@ class CollectorRoutesSpec extends Specification { def getCookieCalls: List[CookieParams] = cookieCalls.toList override def preflightResponse(req: Request[IO]): IO[Response[IO]] = - IO.delay(Response[IO](status = Ok, body = Stream.emit("preflight response").through(text.utf8.encode))) + IO.pure(Response[IO](status = Ok, body = Stream.emit("preflight response").through(text.utf8.encode))) override def cookie( body: IO[Option[String]],