Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 29, 2024
1 parent a131556 commit 5f420eb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -739,12 +739,13 @@ object ServerSpec extends RoutesRunnableSpec {
} yield assertTrue(isValid)
} +
test("should return 400 Bad Request if Host header is missing") {
val route = Method.GET / "test" -> Handler.ok
val app = Routes(route)
val requestWithoutHost = Request.get("/test")
val route = Method.GET / "test" -> Handler.ok
val app = Routes(route)

// Start the app using RoutesRunnableSpec, which triggers the entire server lifecycle
for {
response <- app.runZIO(requestWithoutHost)
port <- serve(app)
response <- Client.request(Request.get(s"http://localhost:$port/test"))
} yield assertTrue(response.status == Status.BadRequest)
} +
test("should return 200 OK if Host header is present") {
Expand Down

0 comments on commit 5f420eb

Please sign in to comment.