Skip to content
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

Routes order must be more specific #80

Closed
Tarick opened this issue Nov 9, 2021 · 0 comments · Fixed by #82
Closed

Routes order must be more specific #80

Tarick opened this issue Nov 9, 2021 · 0 comments · Fixed by #82
Assignees
Milestone

Comments

@Tarick
Copy link
Contributor

Tarick commented Nov 9, 2021

As per https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/route_matching

When Envoy matches a route, it uses the following procedure:
The HTTP request’s host or :authority header is matched to a virtual host.

Each route entry in the virtual host is checked, in order. If there is a match, the route is used and no further route checks are made.

Independently, each virtual cluster in the virtual host is checked, in order. If there is a match, the virtual cluster is used and no further virtual cluster checks are made.

That means if route with path prefix matching was early in the list of routes for vhost, it will win all routes, even if they're more specific (exact path or regex). We need to ensure that routes in vhost are sorted by:

  1. Exact path first
  2. Longest regex path first
  3. Longest prefix path first
    This must ensure that prefix path / will not match any other routes.
@Tarick Tarick self-assigned this Nov 9, 2021
@Tarick Tarick added the bug label Nov 9, 2021
@Tarick Tarick added this to To do in kusk-gateway via automation Nov 9, 2021
@Tarick Tarick added this to the alpha milestone Nov 9, 2021
@Tarick Tarick moved this from To do to In progress in kusk-gateway Nov 9, 2021
@Tarick Tarick mentioned this issue Nov 10, 2021
4 tasks
@Tarick Tarick linked a pull request Nov 10, 2021 that will close this issue
4 tasks
kusk-gateway automation moved this from In progress to Done Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants