Skip to content

Commit 19ba37d

Browse files
adriaanmclaude
andauthored
Update to Ox 1.0.2 in nettyServerSync3 (#4960)
Bump Ox to 1.0.2 in nettyServerSync3 (also checked documentation3 and examples3). To make it easier to check this doesn't introduce any new warnings, I first had Claude eliminate compilation warnings (under my strict supervision ;-)) This was triggered by some CVEs (CVE-2025-55163, CVE-2025-59419, CVE-2025-12183), which are resolved in `"io.netty" % "netty-codec-http2" % "4.2.7.Final"` and `"io.netty" % "netty-codec-smtp" % "4.2.7.Final"`. --------- Co-authored-by: Claude <[email protected]>
1 parent a480234 commit 19ba37d

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

project/Versions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object Versions {
2727
val json4s = "4.0.7"
2828
val metrics4Scala = "4.3.7"
2929
val nettyReactiveStreams = "3.0.6"
30-
val ox = "0.7.1"
30+
val ox = "1.0.2"
3131
val reactiveStreams = "1.0.4"
3232
val sprayJson = "1.3.6"
3333
val scalaCheck = "1.18.1"

server/netty-server/sync/src/main/scala/sttp/tapir/server/netty/sync/NettySyncServerInterpreter.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package sttp.tapir.server.netty.sync
22

33
import ox.InScopeRunner
44
import sttp.capabilities.WebSockets
5-
import sttp.monad.syntax.*
65
import sttp.shared.Identity
76
import sttp.tapir.server.ServerEndpoint
87
import sttp.tapir.server.interceptor.RequestResult
9-
import sttp.tapir.server.interceptor.reject.RejectInterceptor
108
import sttp.tapir.server.interpreter.{BodyListener, FilterServerEndpoints, ServerInterpreter}
119
import sttp.tapir.server.netty.internal.{NettyBodyListener, RunAsync}
1210
import sttp.tapir.server.netty.{NettyResponse, NettyServerRequest, Route}

server/netty-server/sync/src/test/scala/sttp/tapir/server/netty/sync/NettySyncServerTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class NettySyncServerTest extends AsyncFunSuite with BeforeAndAfterAll {
3636
val (backend, stopBackend) = backendResource.allocated.unsafeRunSync()
3737
def testNameFilter: Option[String] = None // define to run a single test (temporarily for debugging)
3838
{
39+
@scala.annotation.nowarn
3940
val eventLoopGroup = new NioEventLoopGroup()
4041

4142
val interpreter = new NettySyncTestServerInterpreter(eventLoopGroup)
@@ -91,8 +92,9 @@ class NettySyncServerTest extends AsyncFunSuite with BeforeAndAfterAll {
9192
createServerTest.testServerLogic(
9293
endpoint.get.in("hello").out(stringBody).handleSuccess(_ => "ok"),
9394
testNameSuffix = "properly log invalid requests when the URL is malformed"
94-
) { (backend, baseUri) =>
95+
) { (_, baseUri) =>
9596
IO.blocking:
97+
@scala.annotation.nowarn
9698
val conn = new java.net.URL(s"$baseUri/hello?param=%%2G").openConnection().asInstanceOf[java.net.HttpURLConnection]
9799
try
98100
conn.getResponseCode() shouldBe 400

server/netty-server/sync/src/test/scala/sttp/tapir/server/netty/sync/NettySyncTestServerInterpreter.scala

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import sttp.tapir.tests.Port
1212

1313
import scala.concurrent.duration.FiniteDuration
1414
import sttp.capabilities.WebSockets
15+
import scala.annotation.nowarn
1516

17+
@nowarn
1618
class NettySyncTestServerInterpreter(eventLoopGroup: NioEventLoopGroup)
1719
extends TestServerInterpreter[Identity, OxStreams with WebSockets, NettySyncServerOptions, IdRoute] {
1820
override def route(es: List[ServerEndpoint[OxStreams with WebSockets, Identity]], interceptors: Interceptors): IdRoute = {
@@ -22,13 +24,6 @@ class NettySyncTestServerInterpreter(eventLoopGroup: NioEventLoopGroup)
2224
}
2325
}
2426

25-
def route(es: List[ServerEndpoint[OxStreams with WebSockets, Identity]], interceptors: Interceptors)(using Ox): IdRoute = {
26-
val serverOptions: NettySyncServerOptions = interceptors(NettySyncServerOptions.customiseInterceptors).options
27-
supervised { // not a correct way, but this method is only used in a few tests which don't test anything related to scopes
28-
NettySyncServerInterpreter(serverOptions).toRoute(es, inScopeRunner())
29-
}
30-
}
31-
3227
override def server(
3328
routes: NonEmptyList[IdRoute],
3429
gracefulShutdownTimeout: Option[FiniteDuration] = None

0 commit comments

Comments
 (0)