Skip to content

Commit

Permalink
content_length_1XX_204
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 24, 2024
1 parent 7abba9e commit adc4866
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ object ServerSpec extends RoutesRunnableSpec {
}
} +
test("should not include Content-Length header for 1xx responses") {
val statusCodes = List(Status.Continue, Status.SwitchingProtocols, Status.Processing) // Add more if needed
val statusCodes = List(Status.Continue, Status.SwitchingProtocols, Status.Processing)

ZIO
.foreach(statusCodes) { status =>
Expand All @@ -588,9 +588,9 @@ object ServerSpec extends RoutesRunnableSpec {
val request = Request.get("/info")
for {
response <- app.runZIO(request)
} yield assertTrue(!response.headers.contains(Header.ContentLength.name))
} yield assertTrue(!response.headers.contains(Header.ContentLength.name)) // Ensure no Content-Length header
}
.map(assertTrue(_))
.map(assertTrue(_.forall(identity))) // Collect all results and assert they are true
} +
test("should not include Content-Length header for 204 No Content responses") {
val route = Method.GET / "no-content" -> Handler.fromResponse(Response(status = Status.NoContent))
Expand Down

0 comments on commit adc4866

Please sign in to comment.