Extracts variables from Host Route Predicate.

fixes gh-706
This commit is contained in:
Spencer Gibb
2018-12-10 23:00:34 -05:00
parent 8194137f03
commit 0da60bbeae
8 changed files with 58 additions and 34 deletions

View File

@@ -146,11 +146,15 @@ spring:
- id: host_route
uri: http://example.org
predicates:
- Host=**.somehost.org
- Host={sub}.somehost.org
----
Ant patterns work as well, such as `**.somehost.org`.
This route would match if the request has a `Host` header has the value `www.somehost.org` or `beta.somehost.org`.
This predicate extracts the URI template variables (like `sub` defined in the example above) as a map of names and values and places it in the `ServerWebExchange.getAttributes()` with a key defined in `ServerWebExchangeUtils.URI_TEMPLATE_VARIABLES_ATTRIBUTE`. Those values are then available for use by <<gateway-route-filters,GatewayFilter Factories>>
=== Method Route Predicate Factory
The Method Route Predicate Factory takes one parameter: the HTTP method to match.