Host Mapping before Url Mapping

This commit is contained in:
Spencer Gibb
2016-11-23 15:47:03 -07:00
parent f1d36dec95
commit f3740cbd34
3 changed files with 5 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ public class GatewayHostHandlerMapping extends AbstractHandlerMapping {
public GatewayHostHandlerMapping(GatewayProperties properties, WebHandler webHandler) {
this.properties = properties;
this.webHandler = webHandler;
setOrder(-1);
}
@Override

View File

@@ -21,6 +21,7 @@ public class GatewayUrlHandlerMapping extends AbstractUrlHandlerMapping {
public GatewayUrlHandlerMapping(GatewayProperties properties, WebHandler webHandler) {
this.properties = properties;
this.webHandler = webHandler;
setOrder(0);
}
@Override

View File

@@ -6,9 +6,9 @@ spring:
cloud:
gateway:
routes:
# test1:
# requestPath: /**
# downstreamUrl: http://httpbin.org:80
test1:
requestPath: /**
downstreamUrl: http://httpbin.org:80
test2:
requestHost: '**.example.org'
downstreamUrl: http://httpbin.org:80