diff --git a/zio-http/jvm/src/main/scala/zio/http/netty/server/ServerInboundHandler.scala b/zio-http/jvm/src/main/scala/zio/http/netty/server/ServerInboundHandler.scala index 8d43c1f88e..5298e14c6f 100644 --- a/zio-http/jvm/src/main/scala/zio/http/netty/server/ServerInboundHandler.scala +++ b/zio-http/jvm/src/main/scala/zio/http/netty/server/ServerInboundHandler.scala @@ -213,7 +213,7 @@ private[zio] final case class ServerInboundHandler( case Some(cfg) => val headers = req.headers() val headerName = Header.AcceptEncoding.name - cfg.options.exists(opt => headers.containsValue(headerName, opt.kind.name, true)) + cfg.options.exists(opt => headers.containsValue(headerName, opt.name, true)) } } diff --git a/zio-http/shared/src/main/scala/zio/http/Server.scala b/zio-http/shared/src/main/scala/zio/http/Server.scala index 2cc349d3c5..c5e0913b8b 100644 --- a/zio-http/shared/src/main/scala/zio/http/Server.scala +++ b/zio-http/shared/src/main/scala/zio/http/Server.scala @@ -247,13 +247,15 @@ object Server extends ServerPlatformSpecific { ResponseCompressionConfig(0, IndexedSeq(CompressionOptions.gzip(), CompressionOptions.deflate())) } - sealed trait CompressionOptions + sealed trait CompressionOptions { + val name: String + } object CompressionOptions { - final case class GZip(cfg: DeflateConfig) extends CompressionOptions - final case class Deflate(cfg: DeflateConfig) extends CompressionOptions - final case class Brotli(cfg: BrotliConfig) extends CompressionOptions + final case class GZip(cfg: DeflateConfig) extends CompressionOptions { val name = "gzip" } + final case class Deflate(cfg: DeflateConfig) extends CompressionOptions { val name = "deflate" } + final case class Brotli(cfg: BrotliConfig) extends CompressionOptions { val name = "brotli" } /** * @param level