From 6514ff7adcb170fa7e153c08f6e91135a4b4aa9a Mon Sep 17 00:00:00 2001 From: Saturn225 <101260782+Saturn225@users.noreply.github.com> Date: Tue, 1 Oct 2024 22:57:29 +0530 Subject: [PATCH] chore(conformance): cleanup netty exception tests --- .../scala/zio/http/ConformanceE2ESpec.scala | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/zio-http/jvm/src/test/scala/zio/http/ConformanceE2ESpec.scala b/zio-http/jvm/src/test/scala/zio/http/ConformanceE2ESpec.scala index 6356d30769..b295dcb9e1 100644 --- a/zio-http/jvm/src/test/scala/zio/http/ConformanceE2ESpec.scala +++ b/zio-http/jvm/src/test/scala/zio/http/ConformanceE2ESpec.scala @@ -34,43 +34,6 @@ object ConformanceE2ESpec extends RoutesRunnableSpec { val res = routes.deploy.status.run(path = Path.root, headers = Headers(Header.Host("localhost"))) assertZIO(res)(equalTo(Status.Ok)) }, - test("should return 400 Bad Request if header contains CR, LF, or NULL (reject_fields_containing_cr_lf_nul)") { - val routes = Handler.ok.toRoutes - - val resCRLF = - routes.deploy.status.run(path = Path.root / "test", headers = Headers("InvalidHeader" -> "Value\r\n")) - val resNull = - routes.deploy.status.run(path = Path.root / "test", headers = Headers("InvalidHeader" -> "Value\u0000")) - - for { - responseCRLF <- resCRLF - responseNull <- resNull - } yield assertTrue( - responseCRLF == Status.BadRequest, - responseNull == Status.BadRequest, - ) - }, - test("should return 400 Bad Request if there is whitespace between start-line and first header field") { - val route = Method.GET / "test" -> Handler.ok - val routes = Routes(route) - - val malformedRequest = Request - .get("/test") - .copy(headers = Headers.empty) - .withBody(Body.fromString("\r\nHost: localhost")) - - val res = routes.deploy.status.run(path = Path.root / "test", headers = malformedRequest.headers) - assertZIO(res)(equalTo(Status.BadRequest)) - }, - test("should return 400 Bad Request if there is whitespace between header field and colon") { - val route = Method.GET / "test" -> Handler.ok - val routes = Routes(route) - - val requestWithWhitespaceHeader = Request.get("/test").addHeader(Header.Custom("Invalid Header ", "value")) - - val res = routes.deploy.status.run(path = Path.root / "test", headers = requestWithWhitespaceHeader.headers) - assertZIO(res)(equalTo(Status.BadRequest)) - }, ) override def spec =