Skip to content

Commit

Permalink
Update Netty to latest version, 4.1.117.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Jan 19, 2025
1 parent 5418a2a commit c674d0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt.*

object Dependencies {
val JwtCoreVersion = "10.0.1"
val NettyVersion = "4.1.116.Final"
val NettyVersion = "4.1.117.Final"
val NettyIncubatorVersion = "0.0.25.Final"
val ScalaCompactCollectionVersion = "2.12.0"
val ZioVersion = "2.1.11"
Expand Down
16 changes: 6 additions & 10 deletions zio-http/jvm/src/main/scala/zio/http/netty/model/Conversions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
package zio.http.netty.model

import scala.collection.AbstractIterator

import zio.http.Server.Config.CompressionOptions
import zio.http._

import com.aayushatharva.brotli4j.encoder.Encoder
import io.netty.handler.codec.compression.StandardCompressionOptions
import io.netty.handler.codec.compression.{BrotliMode, StandardCompressionOptions}
import io.netty.handler.codec.http._
import io.netty.handler.codec.http.websocketx.WebSocketScheme

Expand Down Expand Up @@ -150,15 +148,13 @@ private[netty] object Conversions {
case CompressionOptions.Deflate(cfg) =>
StandardCompressionOptions.deflate(cfg.level, cfg.bits, cfg.mem)
case CompressionOptions.Brotli(cfg) =>
StandardCompressionOptions.brotli(
new Encoder.Parameters().setQuality(cfg.quality).setWindow(cfg.lgwin).setMode(brotliModeToJava(cfg.mode)),
)
StandardCompressionOptions.brotli(cfg.quality, cfg.lgwin, brotliModeToJava(cfg.mode))
}

def brotliModeToJava(brotli: CompressionOptions.Mode): Encoder.Mode = brotli match {
case CompressionOptions.Mode.Font => Encoder.Mode.FONT
case CompressionOptions.Mode.Text => Encoder.Mode.TEXT
case CompressionOptions.Mode.Generic => Encoder.Mode.GENERIC
def brotliModeToJava(brotli: CompressionOptions.Mode): BrotliMode = brotli match {
case CompressionOptions.Mode.Font => BrotliMode.FONT
case CompressionOptions.Mode.Text => BrotliMode.TEXT
case CompressionOptions.Mode.Generic => BrotliMode.GENERIC
}

def versionToNetty(version: Version): HttpVersion = version match {
Expand Down

0 comments on commit c674d0b

Please sign in to comment.