Host Mapping before Url Mapping
This commit is contained in:
@@ -33,6 +33,7 @@ public class GatewayHostHandlerMapping extends AbstractHandlerMapping {
|
||||
public GatewayHostHandlerMapping(GatewayProperties properties, WebHandler webHandler) {
|
||||
this.properties = properties;
|
||||
this.webHandler = webHandler;
|
||||
setOrder(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ public class GatewayUrlHandlerMapping extends AbstractUrlHandlerMapping {
|
||||
public GatewayUrlHandlerMapping(GatewayProperties properties, WebHandler webHandler) {
|
||||
this.properties = properties;
|
||||
this.webHandler = webHandler;
|
||||
setOrder(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user