implemented simple priority in the routing

This commit is contained in:
Tom Gardham-Pallister
2018-01-05 21:14:17 +00:00
parent 9f8da1fbe4
commit 9de00d6a46
12 changed files with 197 additions and 46 deletions

View File

@ -80,9 +80,7 @@ Ocelot's routing also supports a catch all style routing where the user can spec
"UpstreamHttpMethod": [ "Get" ]
}
There is a gotcha if you want to do this kind of thing. The order of the ReRoutes in the config will now matter.
If you had this ReRoute after the catch all then it would never be matched. However if it was before the catch all it would match first.
The catch all has a lower priority than any other ReRoute. If you also have the ReRoute below in your config then Ocelot would match it before the catch all.
.. code-block:: json
@ -93,6 +91,4 @@ If you had this ReRoute after the catch all then it would never be matched. Howe
"DownstreamHost" "10.0.10.1",
"UpstreamPathTemplate": "/",
"UpstreamHttpMethod": [ "Get" ]
}
This is because when Ocelot tries to match a request to a ReRoute it has to look at all the possible matches and uses a regular expression to test the url.
}