Hi Alan,
On Friday, March 17, 2017 at 12:25:09 PM UTC+1, Alan Burlison wrote:
>
> pathPrefix("root") {
> concat(
> pathPrefix("service1") { service1.route },
> pathPrefix("service2") { service2.route }
> )
> }
>
> That works fine with a path of say "/root/service1", but it
> *also* matches "/rootnotroot/service1", because pathPrefix() just
> matches any arbitrary string prefix and not a full path segment.
>
No, it doesn't match `/rootnotroot/service1` (or it least it should not).
You are right, that `pathPrefix(string)` only matches a prefix of the
string, but it also matches a leading slash. So, if you are using the
recommended `pathPrefix("xyz") { pathPrefix("abc") { path("innerMost") } }`
pattern, then the problem you describe is never a problem as the only path
that is matched is `/xyz/abc/innerMost`.
The only place where it would matter is if you complete a route from a
place where not the whole path is expected to be matched, i.e. there's
still something left in `ctx.unmatchedPath`. Is that what you are doing?
Johannes
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.