c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
813 stars 83 forks source link

Match after end of routes #117

Open shoehn opened 5 years ago

shoehn commented 5 years ago

Hi, I understand that r3 uses a prefix tree to implement the matching of the routes. When I add two routes "/test" and "/test2", I can also match "/test3". That is because "/test" is a prefix of "/test3", correct?

Is that intended behaviour? How can I recognize that in my implementation of the routing? Or is it just that we don't care as long as our routing starts correctly what follows after that correct route?

Thanks for the great library!

Sebastian

c9s commented 5 years ago

This might be a bug, we need to fix it.

Sebastian Hoehn notifications@github.com於 2018年10月25日 週四,21:56寫道:

Hi, I understand that r3 uses a prefix tree to implement the matching of the routes. When I add two routes "/test" and "/test2", I can also match "/test3". That is because "/test" is a prefix of "/test3", correct?

Is that intended behaviour? How can I recognize that in my implementation of the routing? Or is it just that we don't care as long as our routing starts correctly what follows after that correct route?

Thanks for the great library!

Sebastian

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/c9s/r3/issues/117, or mute the thread https://github.com/notifications/unsubscribe-auth/AADGzhwQs6q5xJfYx_oCQvIPg7rKxivHks5uocMOgaJpZM4X6VnN .