Skip to content

Commit

Permalink
Migrate main
Browse files Browse the repository at this point in the history
  • Loading branch information
987Nabil committed May 23, 2024
1 parent 911b5ff commit 4ee2955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down
10 changes: 6 additions & 4 deletions zio-http/shared/src/main/scala/zio/http/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ee2955

Please sign in to comment.