We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The feature of nesting routes is exposing paths on both the original path, and on the nested path. https://zio.dev/zio-http/reference/routing/routes#nested-routes
To Reproduce I found it by curl-ing my app, but here is a reproducer using both the direct request syntax and calling the server directly
//> using dep "dev.zio::zio-http:3.0.1" import zio.* import zio.http.* import zio.http.codec.PathCodec object HelloWorld extends ZIOAppDefault: val routed = PathCodec.literal("foo") / Routes( Method.GET / "hello" -> handler(Response.text("World")) ) val hello = Request.get("http://localhost:8080/hello") val fooHello = Request.get("http://localhost:8080/foo/hello") override def run = { for { res1 <- routed.runZIO(hello).debug //Gives OK res2 <- routed.runZIO(fooHello).debug //Gives OK p <- Server.serve(routed).forkDaemon res3 <- Client.batched(hello).debug //Gives OK res4 <- Client.batched(fooHello).debug //Gives OK _ <- p.interrupt } yield () }.provide(Server.default ++ Client.default)
Expected behaviour Only the requests to fooHello respond with 200 OK, with the requests to hello giving 404.
fooHello
hello
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The feature of nesting routes is exposing paths on both the original path, and on the nested path.
https://zio.dev/zio-http/reference/routing/routes#nested-routes
To Reproduce
I found it by curl-ing my app, but here is a reproducer using both the direct request syntax and calling the server directly
Expected behaviour
Only the requests to
fooHello
respond with 200 OK, with the requests tohello
giving 404.The text was updated successfully, but these errors were encountered: