Skip to content

Commit

Permalink
Fix description of routing priorities with multiple paths
Browse files Browse the repository at this point in the history
This PR updates the documentation to reflect the change in
Kong/kong#10615, which makes
traditional_compat mode behave like the traditional router
with respect to priorities of routes having multiple paths.
  • Loading branch information
hanshuebner committed Apr 5, 2023
1 parent 48be244 commit e218d54
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/_src/gateway/key-concepts/routes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ configured like prior releases, and the `expressions` mode which uses
a new configuration scheme.

The default mode of the router is `traditional_compat` and the
following sections describe how it is operates. For a description of
the `expressions` mode, see
following sections describe how it is operates. `traditional_compat`
mode is designed to behave like the router present in versions before
release 3.0. For a description of the `expressions` mode, see
[How to Configure Routes using Expressions](expressions).

In general, the router orders all defined routes by their priority and
Expand All @@ -36,6 +37,10 @@ which of the matching routes will be used and {{site.base_gateway}}
will use either of them according to how its internal data structures
are organized.

If a route contains prefix or regular expression paths, the priority
of the route will be calculated separately for each of the paths and
requests will be routed accordingly.

In `traditional_compat` mode, the priority of a route is determined as
follows, by the order of descending significance:

Expand Down Expand Up @@ -80,10 +85,9 @@ sorts the routes as follows:
length of their paths. Routes with longer paths are considered
before routes with shorter paths.

If one of the paths is a regular expression, the whole route is
considered before routes that have no regular expressions. Similarly,
if a route contains multiple prefix paths (and no regular
expressions), its priority is determined by the longest of the paths.
For a route with multiple paths, each path will be considered
separately for priority determination. Effectively, this means that
separate routes exists for each of the paths.

## Regular expressions

Expand Down

0 comments on commit e218d54

Please sign in to comment.