-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
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
http4s backend doesn't fail when there is additional path to consume after match #23
Comments
Hmm, looks like this causes other problems. Please don't merge yet! |
I added this test, and it causes the two backends to disagree: testServer(in_empty_path_out_string, () => pureResult(Either.right[Unit, String]("")), "empty path should match empty path") { baseUri =>
sttp.get(uri"$baseUri").send().map(_.code shouldBe com.softwaremill.sttp.StatusCodes.Ok)
} Akka doesn't like this, http4s does (note: I'm not actually using http4s' matching mechanism in that interpeter) |
Shouldn't
? This change makes both http4s and akka servers to fail on |
Honestly it's not really clear what the expected behaviour is here :/ |
I'd say that if there are no path constraints specified, then the path is unconstrained. Same as with the method
What about
So I think it might be logical that specifying |
Isn't more obvious for the user to pass |
We are hurting a bit by stringly types here. In the http4s dsl there's a singleton root path called |
@ghostbuster91 well we'll always only be able to detect empty strings at runtime (not compile-time). But as I understand, we have two possibilities:
Which one is better, is of course the question? :) |
I vote for 1 |
I have a third proposition which is just a slightly modification of the 2nd. Cons:
Pros:
Pro & Con: |
e.g.
/my/path/is/good
is matched byendpoint.get.in("my" / "path")
even though there is more to consume.The text was updated successfully, but these errors were encountered: