add a new routing policy to HTTPServer
localvar opened this issue · comments
Bomin Zhang commented
There are two types of HTTP routing policies, both have their advantages and disadvantages:
- match route entries in the order of configuration
- match exact path first, then prefixes (from longer to shorter), then regular expressions (in the configured order)
currently, Easegress only supports the 1st, but users are asking for the 2nd. The solution would be:
- implement the 2nd policy
- add an option to the spec of
HTTPServer
to let the user select which policy is desired
Hao Chen commented
To support the 2nd policy, the following matching algorithms can be considered.
- exact matching, we can use the hash table
- prefix matching, we can use the radix tree
- regex matching, we only can do in-order checking.
aniaan commented
Consider plugging in the route so that users can customize the route implementation