Fixes gh-2933 GatewayFilter support @Order annotation (#2934)
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.filter.OrderedGatewayFilter;
|
||||
import org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory;
|
||||
import org.springframework.cloud.gateway.route.Route;
|
||||
import org.springframework.core.DecoratingProxy;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
@@ -43,6 +44,7 @@ import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.G
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Spencer Gibb
|
||||
* @author Yuxin Wang
|
||||
* @since 0.1
|
||||
*/
|
||||
public class FilteringWebHandler implements WebHandler {
|
||||
@@ -124,7 +126,7 @@ public class FilteringWebHandler implements WebHandler {
|
||||
|
||||
}
|
||||
|
||||
private static class GatewayFilterAdapter implements GatewayFilter {
|
||||
private static class GatewayFilterAdapter implements GatewayFilter, DecoratingProxy {
|
||||
|
||||
private final GlobalFilter delegate;
|
||||
|
||||
@@ -145,6 +147,11 @@ public class FilteringWebHandler implements WebHandler {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDecoratedClass() {
|
||||
return delegate.getClass();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user